The behavior of println is to use a dynamically linked var called *out* as its output stream. emacs dynamically binds *out* to go to the replication buffer for code evaluated in the replication buffer, but if you create a stream, this stream *out* gets the root *out* binding, which in the case of cider will not be a replica buffer.
If you started the replica using cider-jack-in , when viewing the buffer list, there should be a buffer with a name of the type *nrepl-server* , which contains the output of the root binding *out* . Here is my content after running your code:
nREPL server started on port 52034 on host 127.0.0.1 - nrepl://127.0.0.1:52034 Finished 1 on Thread[Thread-9,5,main] Finished 0 on Thread[Thread-8,5,main] Finished 2 on Thread[Thread-10,5,main] Finished 3 on Thread[Thread-11,5,main] Finished 4 on Thread[Thread-12,5,main]
If you did not use cider-jack-in , the output will be printed to the terminal where you started the nrepl process.
source share