This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import '[clojure.lang Reflector]) | |
(defn static-invoke [class member & args] | |
(if (zero? (count args)) | |
(try | |
(Reflector/getStaticField class member) | |
(catch Exception e | |
(Reflector/invokeStaticMethod | |
class member clojure.lang.RT/EMPTY_ARRAY))) | |
(Reflector/invokeStaticMethod class member (object-array args)))) |