(def fibs (lazy-cat [0N 1N] (map + fibs (rest fibs))))
which is an example of (memory consuming) corecursion that I managed to sneak into two recent articles:
http://arstechnica.com/science/2014/05/scientific-computings...
and
http://lee-phillips.org/lispmath/
(I did not come up with this.)
fibs = 1:1:zipWith (+) fibs (tail fibs)
(def fibs (lazy-cat [0N 1N] (map + fibs (rest fibs))))
which is an example of (memory consuming) corecursion that I managed to sneak into two recent articles:
http://arstechnica.com/science/2014/05/scientific-computings...
and
http://lee-phillips.org/lispmath/
(I did not come up with this.)