I don't know the history of the answer to "why", except perhaps as hinted by 
Evan's answer, which is that it becomes implicit how to combine the results of 
the multiple values to get the final true/false for the if condition.  You 
imply "and", which is a perfectly reasonable choice.

My main reason for responding is to let you know that if you really want such 
behavior, macros let you roll your own without much trouble.

Andy

On Jan 3, 2013, at 10:24 PM, Edward Tsech wrote:

> Hey guys,
> 
> if-let and when-let macros support only 2 forms in binding vector:
> 
> (if-let [x 1 y 2]
>   ...)
> java.lang.IllegalArgumentExcepdtion: if-let requires exactly 2 forms in 
> binding vector(NO_SOURCE_FILE:1)
> 
> Why doesn't "if-let" support any even amount of binding forms as "let" does?
> 
> e.g.
> (if-let [x 1 y 2 z 3]
>   (+ x y z)
>   0) ; => 6
> 
> (if-let [x 1 y nil z 3]
>   (+ x y z)
>   0) ; => 0
> 
> Thanks!

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to