3 ms·
also. I have absolutely no idea how the first one even works. fib-seq is not a defined token. wtf is going on here?
by GhotiFish 13y ago
also. I have absolutely no idea how the first one even works.
fib-seq is not a defined token. wtf is going on here?
- elwell 13y agoI don't know Clojure, but I assume it's supposed to be: (rest fibonacci) fibonacci) i don't know actually...
- zcam 13y agoIt's sloppy copy/paste work from http://en.wikibooks.org/wiki/Clojure_Programming/Examples/Lazy_Fibonacci http://en.wikibooks.org/wiki/Clojure_Programming/Examples/La... This post is quite poor imho, and I am a clojure developer (I do use it at work as main language). Maybe it's also because I don't find Midje appealing at all, or find a bit odd the minimalism argument when talking about lighttable vs emacs. If you know what you're doing with cider-mode (previously nrepl) on emacs there's no reason at all to switch to lighttable, quite the opposite. LT is probably good for newcomers, but for power users it's just not there yet (if ever). Same goes for Marginalia, interesting and amusing, but I wouldn't use this for real documentation.
- delluminatus 13y agoIt 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...