I'm not 100% sure but this is a side effect of the property that symbols 
can be used as functions that find themselves on maps.

For instance:

(def m {'a 1 'b 2 'c 3})
('a m)
;=> 1
('b m)
;=> 2

and, when the symbols is not found, we have:

('d m)
;=> nilurn
('d m :nono)
;=> :nono

So a symbol is a function with one or two parameters, the first one the map 
to find itself too and the second, the value to return if not found.

In your example 1 is the supposed map (and 'foo is never found on it) and 2 
is the default value to use.

If you want to read the implementation is in 
clojure.lang.Symbol<https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Symbol.java>
.

Juan Manuel

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