Hi,

I've just been brushing up my knowledge about clojure multimethods and was
wondering about an example at http://clojure.org/multimethods (see below).

What I don't get is how a (class []) gets dispatched to ::collection.

(class []) returns clojure.lang.PersistentVector which doesn't seem to
satisfy the isa? relationship.

Thx

Las

(defmulti foo class)(defmethod foo ::collection [c]
:a-collection)(defmethod foo String [s] :a-string)
 (foo []):a-collection
 (foo (java.util.HashMap.)):a-collection
 (foo "bar"):a-string

-- 

László Török

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