> As an aside, when playing around with quoting and unquoting, I noticed
> that the result of ('+ 3 5) is 5. I'm not sure what I would have
> expected (maybe an error?) but it wasn't the third item of the list.
> Is there any reason for this?
>From http://clojure.org/data_structures:
Symbols, just like Keywords, implement IFn for invoke() of one argument (a map)
with an optional second argument (a default value). For example('mysym
my-hash-map :none) means the same as (get my-hash-map 'mysym :none).
So ('+ 3 5) means "Look up '+ in 3, returning what you find, or 5 if you
can't find it.
Stu
Stuart Halloway
Clojure/core
http://clojure.com
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
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