I take it it's not possible via this? => (doc find-protocol-impl) ------------------------- clojure.core/find-protocol-impl ([protocol x]) nil nil
(implying I've no idea what protocols are) But I'm currently trying to do something similar in a way, I need to return a map from a macro to which I 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 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://github.com/clojurewerkz/support/blob/master/src/clojure/clojurewerkz/support/json.clj#L18-33 > > Any better solutions? I'd like to avoid adding any new dependencies, if > possible. > > Thank you in advance. > -- > MK > > http://github.com/michaelklishin > http://twitter.com/michaelklishin > > -- > 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 -- I may be wrong or incomplete. Please express any corrections / additions, they are encouraged and appreciated. At least one entity is bound to be transformed if you do ;) -- 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