Paste
Pasted as Lisp by 123 ( 15 years ago )
(defprotocol AProtocol
(foo [this]))
(extend-protocol AProtocol
Object
(foo [x] (println "object") x)
MyEntity
(foo [x] (println "entity") x))
(foo (MyEntity. 1 2 3)) => entity
(foo (first (ds/query MyEntity))) => object
(class (first (ds/query MyEntity))) => my.ns.MyEntity
Revise this Paste