I had some trouble understanding this at first too.
"Here I want to dispatch on the class of the first argument xs. "
on the first aargument, ie xs, or on the first argument of xs?
This should work:
(defmulti group
(fn [xs n]
(class xs)))
(defmulti group
(fn [xs n]
(class (first xs))))
(defmethod group dispatch-type [xs n] ...)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---