Using the for list comprehension returns unexpected results

Viewed 186

so I try this code

(for [x (range 1 8) y (range 1 8) :while (and (< x y) (even? x))] [x y])

and get back ()

but I try this:

(for [x (range 1 8) y (range 1 8) :while (and (< y x) (even? x))] [x y])

and I get the desired result. What effect did changing the positions of x and y have? The first snippet shouldn't return an empty list.. after all there have to be some even x's smaller than y

1 Answers
Related