Then probably something like this will help me out
(defn defmutualmethods [multifn dispatch-val & fn-tail] (defmethod multifn dispatch-val fn-tail) (defmethod multifn (reverse dispatch-val) fn-tail)) Nevertheless i'm making things more complex now because it does two things now! But it will make it easier for me i guess. its just a thought On Tuesday, November 20, 2012 9:19:23 PM UTC+1, Brian Marick wrote: > > > On Nov 20, 2012, at 10:22 AM, Thomas Goossens wrote: > > > I think it is a bit dull that for every combination [type1 type2] you > have to define an equivalent method for [type2 type1] > > > > Is there a way to address this problem? perhaps with sets? > > > According to http://clojure.org/multimethods only vectors work if you > want to have a type hierarchy. I wish sets worked, but then you'd have to > also have some sort of destructuring mechanism to bind the parameters. > > ----- > Brian Marick, Artisanal Labrador > Contract programming in Ruby and Clojure > Occasional consulting on Agile > Writing /Functional Programming for the Object-Oriented Programmer/: > https://leanpub.com/fp-oo > > > -- 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