I've been experimenting a lot with extending Clojure's protocols to already existing types, but it seems like whenever I have a question like "How would I extend this protocol to all seq-able collections?" or "How would I extend this protocol to all numbers (longs, ratios, integers, floats, etc.)?" I have to do a lot of googling to find the answers, and even then, I'm not always able to find a definitive answer.
Is anyone aware of a handy reference for commonly used clojure.lang.Something
, java.lang.SomeJavaClass
, etc. classes and protocols? I think it would be beneficial if we had some resource available to help out the Clojurians like myself who have little to no Java experience.
EDIT: To give you an idea of what I'm looking for, in this code:
(defprotocol X
(do-something [this]))
(extend-protocol X
?????? <--
(do-something [this] '(implementation goes here)))
Is there a resource that might have a list of Clojure/Java classes to which it might be useful to extend a protocol?
No direct answer here, but some useful resources: