seems like i can use an interface in deftype, but i can't subsequently
make the type participate in an interface, only a protocol, which is
confusing to me: i expected extend to be less restrictive, if
anything, than deftype. (or am i just getting the syntax horribly
wrong again? it didn't seem like it, looking at the docs.)

user=> (deftype Btype [f1])
#'user/Btype
user=> (deftype Ctype [] clojure.lang.Counted (count [] 0))
#'user/Ctype
user=> (extend ::Btype clojure.lang.Counted {:count (fn [t] 0)})
java.lang.NullPointerException (NO_SOURCE_FILE:0)
user=> (defprotocol P (foo [x]))
P
user=> (extend ::Btype P {:foo (fn [t] 0)})
nil

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

Reply via email to