I think you simply need to get the syntax right. The following works
fine for me:
user= (defprotocol p (foo [this]))
p
user= (deftype a [f] p (foo []))
#'user/a
user= (foo (a nil))
nil
user= (deftype a [f] :as this p (foo [] [this]))
#'user/a
user= (foo (a nil))
[#:a{:f nil}]
On Mon, Jan 4,
thanks Konrad Jonas. i figured/hoped it was something stupid simple.
(for some reason i don't know where to find the latest syntax
documented.)
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
ah! i think i was screwing up with git :-(
(doc deftype) looks right now.
On Mon, Jan 4, 2010 at 10:36 AM, Raoul Duke rao...@gmail.com wrote:
thanks Konrad Jonas. i figured/hoped it was something stupid simple.
(for some reason i don't know where to find the latest syntax
documented.)
--
hi,
i've only heard crickets so far, am i really the only one who can't
get this to work? help? :-} thanks. i figure i must be doing something
dirt simple wrong?
Clojure 1.1.0-new-SNAPSHOT
user= (defprotocol p (foo [this]))
p
user= (deftype a [f] [p] (.foo [this]))
java.lang.RuntimeException:
On 4 Jan 2010, at 05:37, Raoul Duke wrote:
i've only heard crickets so far, am i really the only one who can't
get this to work? help? :-} thanks. i figure i must be doing something
dirt simple wrong?
Clojure 1.1.0-new-SNAPSHOT
user= (defprotocol p (foo [this]))
p
user= (deftype a [f] [p]