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