Re: deftype implementing methods with multiple argument lists

2010-01-20 Thread Konrad Hinsen
On 19 Jan 2010, at 22:32, Stuart Sierra wrote: You can include multiple definitions of the same method, with different arguments, in a deftype. (deftype Foo [f] (bar [x] ...) (bar [x y] ...)) Don't know if that's intended, but it works. Indeed, thanks! Assuming that this is an

deftype implementing methods with multiple argument lists

2010-01-19 Thread Konrad Hinsen
Protocols permit the declaration of functions with multiple argument lists: (defprotocol FooP (bar [x] [x y] )) It is straightforward to implement those using extend or extend-type: (deftype Foo [f] :as this) (extend-type ::Foo FooP (bar ([x] (:f x)) ([x y] [(:f x) y])))

Re: deftype implementing methods with multiple argument lists

2010-01-19 Thread Stuart Sierra
You can include multiple definitions of the same method, with different arguments, in a deftype. (deftype Foo [f] (bar [x] ...) (bar [x y] ...)) Don't know if that's intended, but it works. -SS On Jan 19, 3:50 pm, Konrad Hinsen konrad.hin...@fastmail.net wrote: Protocols permit the