On Thu, Jul 15, 2010 at 12:16, ka <[email protected]> wrote: >> (for [a (r 2), b (r 3)] [a b]) >> ; produces: >> <range 2> >> (<range 3> >> [0 0] [0 1] <range 3> >> [0 2] [1 0] [1 1] [1 2]) > > Why does (r 2) get evaluated before the seq is needed ? > > => (def k (for [a (r 2), b (r 3)] [a b]) ) > <range 2> > #'a/k
It doesn't get evaluated before it's needed. As far as the implementation is concerned, it is needed before (r 3) is evaluated. Chouser <[email protected]> wrote, in part: ... > inner seq expressions to the right can refer to locals defined > further to the left ... Clear? // Ben -- 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
