On Thu, Jul 15, 2010 at 12:16, ka <sancha...@gmail.com> 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 <chou...@gmail.com> 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 clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en