Hi, Am 03.08.2009 um 16:56 schrieb Jonas Enlund:
In the following example :while and :when are interchangeable, which is often the case when :while is used last in the list comprehension:user=> (for [x (range 1 10) y (range 1 10) :while (< (+ x y) 5)] [x y])([1 1] [1 2] [1 3] [2 1] [2 2] [3 1]) user=> (for [x (range 1 10) y (range 1 10) :when (< (+ x y) 5)] [x y]) ([1 1] [1 2] [1 3] [2 1] [2 2] [3 1])
I would suspect, that :while stops earlier than :when. So while the result is the same, I would suspect that the :while has a (even if tiny) performance advantage. Sincerely Meikel
smime.p7s
Description: S/MIME cryptographic signature