当我尝试在 Clojure 中运行以下代码(来自 REPL)时:
(dotimes [i 5]
(.start
(Thread.
(fn []
(Thread/sleep (rand 1000))
(println (format "Finished %d on %s" i (Thread/currentThread)))))))
我收到以下错误:
java.lang.Exception: Unable to resolve symbol: i in this context
clojure.lang.Compiler$CompilerException: NO_SOURCE_FILE:6: Unable to resolve symbol: i in this context
at clojure.lang.Compiler.analyze(Compiler.java:3713)
我在这里做错了什么?