好的,Clojure 中的斐波那契函数:
(defn give-fibs []
((fn fib-seq [a b]
(cons a (lazy-seq (fib-seq b (+ a b)))))
0 1))
现在,我的问题是,当我这样称呼它时,我得到一个错误:
(take 10 give-fibs)
编辑,错误是 -java.lang.IllegalArgumentException: Don't know how to create ISeq from: four_cloj.core$give_fibs
但是,当我打电话时它有效:
(take 10 (give-fibs))
当我检查发生了什么时,我无法真正解释它:
(class (give-fibs)) ; clojure.lang.Cons
(class give-fibs) ; four_cloj.core$give_fibs
??