and defn-match from the matchure library might be able to solve some of your
problems .. Just a wild guess .. to solve the wild-cards problem ... :)
Just look at
http://github.com/dcolthorp/matchure


On Mon, Oct 25, 2010 at 1:59 PM, Sunil S Nandihalli <
sunil.nandiha...@gmail.com> wrote:

> 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 <m...@kotka.de> 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 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<clojure%2bunsubscr...@googlegroups.com>
>> 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 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