Hello .. Just my two cents.. I think the ability to specify an equality function when creating the multi-method would solve the problem.
for example (defmulti foo dispatch-fn equality-fn) would be very nice. one can use arbitrary functions to match ... which may be reimplemented at users wish to achieve say wild-card support.. Probably it is already happening .. I don't know. Thanks, Sunil. On Sun, Oct 24, 2010 at 2:52 AM, Meikel Brandmeyer <[email protected]> wrote: > Hi, > > if you only dispatch on types you can do it like this: > > (derive Object ::any) > ; Also derive all of your ::keyword types from ::any. > > (defmulti foo #(vec (map type %&))) > > (defmethod foo [::any Integer] ...) > > But this won't work if you dispatch on actual values as you did in > your example. For that there is no way to specify wildcars, AFAIK. > > Sincerely > Meikel > > -- > 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]<clojure%[email protected]> > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > -- 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
