On Jan 27, 2009, at 7:48, Tzach wrote: > I do not understand the benefit of storing the map-board result. > The map-board function it self is using lazy for loop. > Why isn't the laziness transitive automatically?
map-board is indeed lazy, but every time you call it it creates a *new* lazy sequence. In every iteration over n, you thus create an identical lazy sequence by giving the same input to map-board. If you use only one lazy sequence, as in my modification, automatic caching guarantees that each element is evaluated only once. In your version, you don't benefit from this caching. Konrad. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
