Re: Need help understanding a lazy sequence function

2014-03-10 Thread Asfand Yar Qazi
On Monday, 10 March 2014 11:35:30 UTC, Alan Forrester wrote: > > According to the documentation for map > http://clojuredocs.org/clojure_core/clojure.core/map > (map + x y) > > where x and y are two collections adds the first element of x to the > first element of y, the second element of x to

Re: Need help understanding a lazy sequence function

2014-03-10 Thread Asfand Yar Qazi
#x27;t make sense; I still don't understand how (cons 0 (cons 0 fib-seq)) evaluates to '(0) the first time; it should evaluate to '(0 0) since there are 2 cons statements. That's the point I'm stuck on; any help would be gratefully received. On Sun, Mar 9, 2014 a

Need help understanding a lazy sequence function

2014-03-09 Thread Asfand Yar Qazi
Hi, I'm trying to understand the following function (from http://en.wikibooks.org/wiki/Clojure_Programming/Examples/Lazy_Fibonacci#Self-Referential_Version): (def fib-seq (lazy-seq (map + (cons 0 (cons 0 fib-seq)) (cons 1 fib-seq I'm trying to understand how this works. I