(defn prime-numbers [n]
(letfn
[(prime? [n]
(not-any? #(= 0 (mod n %)) (range 2 n)))]
(reduce (fn [xs x]
(cond (= n (count xs)) (reduced xs)
(prime? x) (conj xs x)
:else xs))
[]
(drop 2 (range)))))
这是我的解法,结果4Clojure直接告诉我java.lang.RuntimeException: Unable to resolve symbol: reduced in this context, compiling:(NO_SOURCE_PATH:0)
。不知各位有何见解。