Consider the following MWE:
(ns toto.core
(:gen-class))
(defn write-something [i]
(spit (str "out-" (str i) ".txt") "Hi there!"))
(defn -main
"I don't do a whole lot ... yet."
[& args]
(dorun (pmap write-something (range 16))))
If I run -main
from the REPL, it works as expected: it creates the files and returns. However, if I create an uberjar and run java -jar <toto.whatever-standalone.jar>
it will create the files, but fail to exit the program. I suspect it is an issue with laziness, but can't figure why the dorun
is not working as I'd expect.
Any ideas on what I'm doing wrong?