3 ms·
It looks like an error. The author probably based his code on an example from Wikibooks [1]: (def fib-seq (lazy-cat [0 1] (map + (rest fib-seq) fi
by delluminatus 13y ago
It looks like an error. The author probably based his code on an example from Wikibooks [1]:
(def fib-seq
(lazy-cat [0 1] (map + (rest fib-seq) fib-seq)))
But, since he added an argument to the function, I don't think his code actually works, even if you ran :s/fib-seq/fibonacci
[1]: https://en.wikibooks.org/wiki/Clojure_Programming/Examples/Lazy_Fibonacci https://en.wikibooks.org/wiki/Clojure_Programming/Examples/L...