如果我尝试在我的 emacs cider-repl 中评估以下代码,则会按预期返回 nil,但不会在 repl 缓冲区或控制台中进行任何打印。我怎样才能按预期打印出来?
(dotimes [i 5]
(.start
(Thread.
(fn []
(Thread/sleep (rand 500))
(println (format "Finished %d on %s" i (Thread/currentThread)))))))
;=> nil
但是,这很好用:
(println (format "Finished 1 on %s" (Thread/currentThread)))
;=> Finished 1 on Thread[nREPL-worker-18,5,main]
----------- mini-buffer -----------------
nil