2009/11/15 Angel Java Lopez <ajlopez2...@gmail.com>:
[...]
> (defn spread
>   {:private true}
>   [arglist]
>   (cond
>    (nil? arglist) nil
>    (nil? (next arglist)) (seq (first arglist))
>    :else (cons (first arglist) (spread (next arglist)))))
>
> Where is defined :else keyword behaviour? I can't find how :else is defined
> to be managed in cond/if code

I don't know about your other questions, but I believe :else could be
replace by anything that is logically true.  It's just a convention to
use ":else".

user=> (cond (zero? 42) "42 is zero"
:else "42 is not zero")
"42 is not zero"
user=> (cond (zero? 42) "42 is zero"
true "42 is not zero")
"42 is not zero"
user=> (cond (zero? 42) "42 is zero"
:something-that-is-logically-true "42 is not zero")
"42 is not zero"
user=> (cond (zero? 42) "42 is zero"
"otherwise, if the above is not true, then" "42 is not zero")
"42 is not zero"

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