I need to verify if an object implements a protocol. Looking at the source 
code, I noticed that protocol objects act as a map, and has the key :impls. 
>From this is a map I can look up a class to see if there are functions. The 
resulting code is:

(defn implements? [protocol obj]
  (boolean ((:impls protocol) (class obj))))

The problem with this is this relies on implementation details. I would 
like to do this safely. I noticed that in clojure.core there is a private 
function implements?. This appears to do what I want. Is it possible to 
make this public? What is the motivation for keeping it private?

-- 
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

Reply via email to