Fibonacci
By far the most brain-bendingly elegant definition of all the Fibonacci numbers I have ever encountered:
(def fibs (lazy-cat '(1 2) (map + fibs (drop 1 fibs))))
Found over an the clojure-euler wiki.
Rick Dillon's home on the net…
By far the most brain-bendingly elegant definition of all the Fibonacci numbers I have ever encountered:
(def fibs (lazy-cat '(1 2) (map + fibs (drop 1 fibs))))
Found over an the clojure-euler wiki.