hi,

what is the right way to do frob-self below? or might deftype be
upgraded to support tying the knot or whatever here? thanks!

(defprotocol P1 (frob-v [this]))
(defprotocol P2 (frob-self [this]))

(deftype Trec [v] P1 (frob-v [] (+ 1 v)))
(println (Trec 0))
(println (frob-v (Trec 0)))

(deftype Trec [v] P1 (frob-v [] (+ 1 v)) P2 (frob-self [] (Trec (+ 1 v))))
(println (frob-v (Trec 0)))
(println (frob-self (Trec 0)))
; java.lang.ClassCastException: java.lang.Class cannot be cast to
clojure.lang.IFn (NO_SOURCE_FILE:0)

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