I didn't get the syntax error at all: The first yields: ([0 0] [0 1] ... [0 99]) The second y ields ([0 1] [0 2] .. [0 100]) I don't know why.
On Dec 27, 4:29 pm, "Michael Wood" <esiot...@gmail.com> wrote: > On Sat, Dec 27, 2008 at 11:01 PM, wubbie <sunj...@gmail.com> wrote: > > > Hi, > > Why are they different? > > > (take 100 (for [x (range 1000) y (range 1000) (< x y)][x y])) > > (take 100 (for [x (range 1000) y (range 1000) :when (< x y)][x y])) > > Based on the doc string I think the first one should be a syntax > error. The (< x y) seems to be ignored: > > user=> (take 10 (for [x (range 1000) y (range 1000) this-is-ignored][x y])) > ([0 0] [0 1] [0 2] [0 3] [0 4] [0 5] [0 6] [0 7] [0 8] [0 9]) > user=> > > The doc string implies that you should use :when expr, :while expr or > nothing at all for the filtering expression. > > -- > Michael Wood <esiot...@gmail.com> --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---