On Jul 7, 2009, at 3:29 PM, Stuart Sierra wrote:

If you really don't know what the class is (for example, you get a
Class object returned by some library function) then you can use the
Java Reflection API to call the static method.  See
http://java.sun.com/docs/books/tutorial/reflect/

If you go this route, I recommend either using or learning from the functions in clojure/src/jvm/clojure/lang/Reflector.java. Its methods are not part of Clojure's official interface, so the usual caveats about using unsupported "implementation private" code apply, but it include many useful methods for dealing with reflection from Clojure.

--Steve

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to