On Nov 7, 6:42 pm, Chouser <[EMAIL PROTECTED]> wrote:
> The attached patch modifies the usage of these macros to be more
> like let:
>
> (dotimes [i (range 10)]
>   (prn i))

A few questions. First, isn't the syntax for dotimes:

(dotimes i 10
  (prn i))

And in which case, your vector syntax could be misleading, because it
seems to imply you're assigning i to 10:

(dotimes [i 10]
  (prn i))

Second, with your patch, is the following valid:

(doseq [i (range 10)
        j (range 10)]
  (prn i)
  (prn j))

And if it is, what does it do? Does it iterate through all
permutations of i and j, or does it zip i and j together?

If the above isn't valid, your syntax again seems a little misleading,
since with the let special form, you can assign as many vars as you
want.

Third, even if doseq allows for multiple local vars, you'd still have
problems with when-let and if-let. For instance:

(when-let [x (foo)
           y (bar)]
  (prn x)
  (prn y))

Under what conditions is the body evaluated? If x OR y is true, or if
x AND y is true, or if the last value of the let clause, y, is true?

It's my opinion that the let syntax only makes sense when you have
multiple vars to bind. Otherwise the same syntax has different
meanings depending on the macro; sometimes you can only bind one,
sometimes you can bind many. Currently in Clojure this syntax only has
one meaning, and I think that's more consistent.

- James
--~--~---------~--~----~------------~-------~--~----~
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