Creating Java Objects in Clojure
When calling Java libraries or the Java standard library, you’ll often need to pass in Java objects that either implement an interface or extend a particular class. Clojure provides solutions for this problem in several ways—direct use of Java types and interfaces, anonymous interface implementation with reify, and class extension with proxy.
Direct Use of Java Types
Clojure’s implementation reuses Java’s own concrete types like String, Character, Boolean, the numeric classes, Date, and more. Because these Clojure objects are actually Java objects, they can be passed directly to Java APIs without wrapping or modification.
Additionally, many Clojure objects implement key Java interfaces where applicable, so ...