for what its worth, I'm building a highly polymorphic board-game engine [1] and I've stayed away from multimethods...I've used every single polymorphism capabillity that clojure provides (records/protocols, map-based, HOFs etc) except multi-methods. Performance is acritical matter for this project especially for chess...

Using my lib I've got a purely functional chess, checkers and tic-tac-toe implementations so feel free to check it out...

Jim

[1] https://github.com/jimpil/Clondie24


On 19/11/12 15:32, Thomas Goossens wrote:
Yes indeed. with multimethods you can doue multi-argument dispatch.

But that means that for every possible collision. I have to specify a method?

Would it be a good idea to introduce taxonomies here?

On Monday, November 19, 2012 4:02:18 PM UTC+1, Stuart Sierra wrote:

    A long time ago I posted some macros to do double-dispatch with
    protocols and records. The link was http://paste.lisp.org/+2023
    but it no longer works.

    The basic idea is you dispatch on the first argument to an
    intermediate type that then dispatches on the second argument.
    It's complicated, but essentially mechanical.

    Clojure multimethods have built-in multi-argument dispatch.

    -S

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

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