This is not working for me:

(ns aatree.record-play)

(defprotocol gran
  (blip [x y z]))

(defrecord wackel [])

(defn new-wackel [opts]
  (let [w (->wackel)]
    (into w opts)
    (assoc w :blip (fn [this x y z] (+ x y z)))))

(extend wackel
  gran
  {:blap (fn [this x y z]
           ((:blip this) x y z))})

(println (.blap (new-wackel {}) 1 2 3))


I get this: No matching method found: blap for class aatree.record_play.wackel


I changed the println to this:


(let [^gran w (new-wackel {})]
  (println (.blap w 1 2 3)))


And now I get this: Unable to resolve classname: gran


Clearly there is something about protocols and/or extend that I do not 
understand.

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to