Check that a protocol exists

2012-10-24 Thread Michael Klishin
Is there a way to check if a protocol exists? For example, if I want to extend clojure.data.json protocols but only if it is available, how would I go about it? This way does not work at least some of the time (referenced namespace causes a ClassNotFound exception during compilation): https

Re: Check that a protocol exists

2012-10-24 Thread Baishampayan Ghose
What about the technique Clojure uses in the reducers library? https://github.com/clojure/clojure/blob/master/src/clj/clojure/core/reducers.clj#L37 -BG On Wed, Oct 24, 2012 at 12:20 PM, Michael Klishin michael.s.klis...@gmail.com wrote: Is there a way to check if a protocol exists

Re: Check that a protocol exists

2012-10-24 Thread Kevin Downey
: What about the technique Clojure uses in the reducers library? https://github.com/clojure/clojure/blob/master/src/clj/clojure/core/reducers.clj#L37 -BG On Wed, Oct 24, 2012 at 12:20 PM, Michael Klishin michael.s.klis...@gmail.com wrote: Is there a way to check if a protocol exists

Re: Check that a protocol exists

2012-10-24 Thread AtKaaZ
pass a symbol which may or may not be defined... (that compile-if won't work for me) On Wed, Oct 24, 2012 at 9:20 PM, Michael Klishin michael.s.klis...@gmail.com wrote: Is there a way to check if a protocol exists? For example, if I want to extend clojure.data.json protocols but only