mfikes / ambly

ClojureScript REPL into embedded JavaScriptCore
http://ambly.fikesfarm.com
Eclipse Public License 1.0
540 stars 21 forks source link

Need to set a *print-fn* #9

Closed mfikes closed 9 years ago

mfikes commented 9 years ago
ClojureScript:cljs.user> (println "ab")
Error: No *print-fn* fn set for evaluation environment
mfikes commented 9 years ago

I vaguely recall having commented out the relevant line that would have added the print function thinking the "util" module isn't available.

mfikes commented 9 years ago

Note that

(enable-console-print!)

is insufficient, as it currently redirects things to the Xcode log.

Here, for example, is what happens if you do this and then get the doc for `enable-console-print!`
2015-02-05 00:46:34.924 Ambly Demo[6783:182464] JS: -------------------------
2015-02-05 00:46:34.924 Ambly Demo[6783:182464] JS: cljs.core/enable-console-print!
2015-02-05 00:46:34.925 Ambly Demo[6783:182464] JS: ([])
2015-02-05 00:46:34.925 Ambly Demo[6783:182464] JS:   Set *print-fn* to console.log

Interestingly, in the Shrimp project, this is what is done, and something in the REPL stack in use there causes the output to be redirected to the REPL. (I say "redirected" because I see output in Xcode and then it starts appearing in the REPL.)