This is because the main thread in CIDER / Emacs associates the REPL output buffer with *out*
dynamic var. This is why you can see things in emacs.
However, when starting a new thread, this binding does not exist. Fixing is quite simple - first create a function that will capture the current binding:
(def repl-out *out*) (defn prn-to-repl [& args] (binding [*out* repl-out] (apply prn args)))
Now that you want to print from another thread, use:
(prn-to-repl "hello")
What is it. Hope this helps.
source share