A form like: (def lazy2 (map #(str "+" %) (range)))
would work. Le mercredi 6 juin 2012 11:24:06 UTC+2, Z.A a écrit : > > Hi > > user=> (def lazy1 (take 3 (iterate #(do (print "+") > (inc %)) 0))) > #'user/lazy1 > user=> lazy1 > (+0 +1 2) > > Why am I not getting (+0 +1 +2) ? > > Thanks > Zubair > > PS: I am reading chapter 6 of 'The Joy of Clojure' and trying to > understand "rest versus next" , pp 116 > > Le mercredi 6 juin 2012 11:24:06 UTC+2, Z.A a écrit : > > Hi > > user=> (def lazy1 (take 3 (iterate #(do (print "+") > (inc %)) 0))) > #'user/lazy1 > user=> lazy1 > (+0 +1 2) > > Why am I not getting (+0 +1 +2) ? > > Thanks > Zubair > > PS: I am reading chapter 6 of 'The Joy of Clojure' and trying to > understand "rest versus next" , pp 116 > > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
