I created a protocol in Clojure 1.2 that processes my own Java classes and has default processing for generic java.lang.Object. The code looks something like this:
(extend-protocol PMyProtocol
my.java.ClassName
(protocol-function [c]
"My Java class result")
java.lang.Object
(protocol-function [c]
"Default object result"))
How can I extend this to have special processing for standard Clojure data structures (in particular, maps, vectors and sequences)?
source
share