On Wed, Dec 10, 2008 at 10:00 PM, Michael Wood <[EMAIL PROTECTED]> wrote:
[...]
> The problem seems to be that you are quoting the +. Not sure why this is,
> but:
>
> user=> ('+ 1 4)
> 4
> user=>
OK, I think I know why this happens. It's treating the '+ as the key
for a map, and using the second integer as the default value. I'm not
sure why it treats an integer as a map, though:
user=> (get {:a 1} :a)
1
user=> (get {:a 1} :b)
nil
user=> (get {:a 1} :b 2)
2
user=> (:a {:a 1})
1
user=> (:b {:a 1})
nil
user=> (:b {:a 1} 2)
2
user=> (:a 1 4)
4
user=> ('a 1 4)
4
user=> ('+ 1 4)
4
user=>
--
Michael Wood <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---