The current cond does allow "else" behavior. It's done using a final test that 
evaluates to something non-false and non-nil, such as the keyword :else.

That said, the proposed arc/newlisp style if macro would be more tidy.

Jeff

----- Original Message -----
From: James Reeves <[EMAIL PROTECTED]>
Sent: Friday 10 October 2008 03:59
To: Clojure <clojure@googlegroups.com>
Cc: 
Subject: Re: "if" small syntax change proposal

> 
> On Oct 9, 10:29 pm, Dmitri P <[EMAIL PROTECTED]> wrote:
> > Allow cond-like specification of expression pairs and allow odd number
> > of expressions. Let odd expressions in last position serve as default
> > return value. There will be no impact on previous reading/writing of
> > "if". Stolen from Paul Graham's Arc.
> >
> > (defmacro myif
> >         ([x] x)
> >         ([x] (if x y))
> >         ([x y & z] (if x y `(myif [EMAIL PROTECTED]))))
> 
> This seems like a sound idea. It eliminates the need to have a
> separate cond macro, and supports an ending "else" statement, which I
> believe is something cond lacks.
> 
> - 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