Re: avoiding duplication using multi-methods

2008-09-01 Thread Parth Malwankar
On Sep 1, 12:26 pm, [EMAIL PROTECTED] wrote: > On Aug 31, 8:48 pm, Parth Malwankar <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > > I have a situation in which different multi-methods > > need similar behavior with different arguments. > > > So they call the same function (one-or-two below) > >

Re: avoiding duplication using multi-methods

2008-09-01 Thread darren . austin
On Aug 31, 8:48 pm, Parth Malwankar <[EMAIL PROTECTED]> wrote: > Hello, > > I have a situation in which different multi-methods > need similar behavior with different arguments. > > So they call the same function (one-or-two below) > with the arguments. E.g. > >     (defmulti what-num (fn [x] x))

avoiding duplication using multi-methods

2008-08-31 Thread Parth Malwankar
Hello, I have a situation in which different multi-methods need similar behavior with different arguments. So they call the same function (one-or-two below) with the arguments. E.g. (defmulti what-num (fn [x] x)) (defn one-or-two [x] (println "saw one or two: " x)) (defmethod what