On Dec 8, 10:08 am, Chouser <[EMAIL PROTECTED]> wrote:
> On Mon, Dec 8, 2008 at 9:06 AM, Rich Hickey <[EMAIL PROTECTED]> wrote:
>
> > On Dec 6, 7:52 pm, André Thieme <[EMAIL PROTECTED]> wrote:
> >> (for [x (range 1 20) :when (> x 8) :while (< 0 (rem x 13))] x) ==>
> >> java.lang.Exception: Unsupported binding form: :while
>
> >> But:
> >> (for [x (range 1 20) :when (> x 8)] x) ==>
> >> (9 10 11 12 13 14 15 16 17 18 19)
>
> >> And:
> >> (for [x (range 1 20) :while (< 0 (rem x 13))] x) ==>
> >> (1 2 3 4 5 6 7 8 9 10 11 12)
>
> >> Is it intended that there can be at most one condition per binding?
>
> > That's how it is currently implemented, but I'm for allowing both.
>
> doseq currently supports both.  If both appear on the same binding,
> the :while is always test first regardless of the order in which they
> appear in the doseq.  The thinking is that if the :while is false,
> there's no need to check the :when.
>
> Is this Good, and should 'for' work the same way?
>

Yes.

Rich

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to