Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ClosureScript & NodeJS: Error: No *print-fn* fn set for evaluation environment

I have followed the "hello world!" examples for NodeJS on both these guides

  • https://github.com/clojure/clojurescript/wiki/Quick-Start#running-clojurescript-on-nodejs
  • http://mmcgrana.github.io/2011/09/clojurescript-nodejs.html

and for each I get this error

Error: No *print-fn* fn set for evaluation environment

Have I missed a step? This seems like a fairly basic problem ... does anyone know where print-fn is set?

like image 653
humanError Avatar asked Feb 10 '14 00:02

humanError


People also ask

What is ClojureScript used for?

ClojureScript is a compiler for Clojure that targets JavaScript. It is designed to emit JavaScript code which is compatible with the advanced compilation mode of the Google Closure optimizing compiler.

Is ClojureScript fast?

ClojureScript is a robust, practical, and fast programming language with a set of useful features that together form a simple, coherent, and powerful tool. Get Started! ClojureScript is a compiler for Clojure that targets JavaScript.

Is Clojure still used?

After 8 years of usage, we have grown to become one of the largest Clojure teams in the world and we are still growing. In fact, after Nubank and Cognitect we don't know of any larger Clojure development team. There's plenty of reasons to continue using Clojure and ClojureScript, many of which are covered here.


1 Answers

You can say

(enable-console-print!)

to print using console.log.

Under the hood, enable-console-print! sets *print-newline* and *print-fn*. Here's the source as of r2156.

like image 167
Michał Marczyk Avatar answered Sep 23 '22 20:09

Michał Marczyk