[CLJ-207] for macro does not allow :let clause in first position Created: 25/Oct/09 Updated: 26/Dec/12 Resolved: 13/Apr/12
|Patch:||Code and Test|
I like to try and keep my level of nesting under control, and this
Is this limitation intentional? Could the error message be improved?
Here's what I wanted to write:
(the formatting is probably scrambled)
But I had to juggle it to this:
Of course there are any number of ways to write this, but I prefer the
|Comment by Assembla Importer [ 24/Aug/10 6:56 AM ]|
Converted from http://www.assembla.com/spaces/clojure/tickets/207
|Comment by Tassilo Horn [ 22/Mar/12 11:21 AM ]|
The attached patch implements that feature and also adds tests for it. The new tests and all other tests still pass.
The patch exploits the fact that
is equivalent to
and thus transforms the former binding vector to the latter.
|Comment by Rich Hickey [ 13/Apr/12 9:20 AM ]|
just put the for in a let please
|Comment by Carl Smotricz [ 26/Dec/12 5:13 AM ]|
I came here to report this as a bug.
I respect Rich's decision to disallow :let at the beginning of a (for), of course, but I feel that if the syntax is to be declared illegal then the compiler should report an error rather than explode with an exception.
Thus I suggest catching the error in the compiler and reporting it as a syntax error.