planck

Planck ClojureScript REPL
spinningarrow 2018-01-03T14:56:07.000029Z

Is there a way to print to standard error from Planck? So far I've gotten (.error js/console "error!") to work but it's a tad ugly

mfikes 2018-01-03T14:58:09.000475Z

@spinningarrow This immediately comes to mind: https://github.com/mfikes/planck/issues/452

mfikes 2018-01-03T15:00:20.000181Z

@spinningarrow Without that, I wonder if (binding [*print-fn* *print-err-fn*] (println "foo")) does the right thing

mfikes 2018-01-03T15:01:35.000260Z

@spinningarrow That’s a fairly common approach in ClojureScript. See https://github.com/clojure/clojurescript/blob/9778b34d9e988a28c64133c4751d235bbbd3e966/src/main/cljs/cljs/js.cljs#L28 for example.

mfikes 2018-01-03T15:05:23.000076Z

@spinningarrow This is also, for example, how analyzer warnings are sent to “stderr”: https://github.com/clojure/clojurescript/blob/9a54081d3e0ffab699ee2e58b2adc595918f7c2b/src/main/clojure/cljs/analyzer.cljc#L488

spinningarrow 2018-01-03T15:11:58.000123Z

Thanks for the info and the quick reply! I'll look into those links