Several improvements have been made to the ClojureScript REPL.
In ClojureScript, the method of printing output will be different for
each evaluation environment. There is now a var named *print-fn* in
cljs.core which will need to be explicitly set to a function that can
print in the target environment. If you would like to ignore all
printed output you could do this:
(set! *print-fn* (constantly nil))
The print function that you specify takes one argument, the value to
be printed. What you do with that value is totally up to you and your
environment. Sane defaults are set when running the REPL with Rhino or
the browser.
We are now using Rhino version 1.7R3 instead of whatever version of
Rhino is bundled with Java. This provides the following benefits:
* better error messages
* nice JavaScript stacktraces
* it's faster
* it isn't tied to a particular VM (should fix the problems people
were seeing on OpenJDK)
You will need to rerun script/bootstrap to download the Rhino jar and
install it in your lib folder. Windows people will need to do this
manually.
http://www.mozilla.org/rhino/download.html
For the browser-connected REPL, we can now print to the REPL. This
means that the browser-connected REPL works exactly like an old-
fashioned Clojure REPL.
For example, you can now do this:
ClojureScript:cljs.user> (time (reduce + (range 1000)))
"Elapsed time: 222 msecs"
499500
If your application is printing things while running then this printed
output will be printed in the REPL. Of course, you can set the *print-
fn* to do whatever you like.
Finally, when using Chrome and Firefox for evaluation, you will now
see JavaScript stacktraces in the REPL.
If you have been using the browser-connected REPL then you will need
to delete the .repl folder before using the new changes.