我正在学习pmap
并编写以下函数:
(pmap #((println "hello from " (-> (Thread/currentThread) .getName))
(+ %1 %2))
[1 1 1] [-1 -1 -1])
运行时,结果是NullPointerException
(hello from clojure-agent-send-off-pool-4
hello from clojure-agent-send-off-pool-3
hello from clojure-agent-send-off-pool-5
NullPointerException user/eval55/fn--56 (NO_SOURCE_FILE:11)
为什么会这样?我已经理解并观察到 a 的主体fn
是一个隐含的do
。