2009/12/20 Mike K <mbk.li...@gmail.com>:
> On Dec 19, 8:27 pm, Sean Devlin <francoisdev...@gmail.com> wrote:
>>  :else was chose because it is simply not nil, and therefor always true.
>
> I suspected something along these lines soon after I posted.  I did
> some more experimenting and discovered that :foo will work just as
> well as :else.  So if I understand correctly, :else is not even
> defined in the language anywhere.  Like :foo, it springs into
> existence when I first mention it, and it evaluates to true by virtue
> of being a keyword.  Cond exploits this behavior for free.

Right.  :else is just a convention.  I believe it's borrowed from
Scheme.  As pointed out by ataggart, anything that's logically true
would work just as well.

> This is in contrast with, e.g., the ns macro, which presumably would
> have to explicitly match against keywords such as :use or :require to
> implement the proper semantics.

Yes, because the ns macro treats them as tokens in its mini-language
instead of just something that's logically true.  i.e. their value
matters.  Not just whether or not they can be treated as "true".

-- 
Michael Wood <esiot...@gmail.com>

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