macros,clojure,clojure-java-interop
For this, I would do compile-time reflection coupled with polymorphism. (defprotocol FieldSettable (set-field! [this k v])) (defmacro extend-field-setter [klass] (let [obj (with-meta (gensym "obj_") {:tag klass}) fields (map #(symbol (.getName ^java.lang.reflect.Field %)) (-> klass str (java.lang.Class/forName) .getFields)) setter (fn [fld] `(fn [~obj v#] (set! (. ~obj ~fld) v#) ~obj))] `(let...
java,clojure,clojure-java-interop
Multidimensional array types have no direct support in Clojure, but you can always fall back to using a String with the binary type name. In your case, this would look like the following: [myFunc ["[[Ljava.lang.String;"] ReturnType] ...
The problem is that I was trying variations of: (.getScreenSize Toolkit) and (.getScreenSize (.getDefaultToolkit Toolkit)) It has to be: (.getScreenSize (Toolkit/getDefaultToolkit)) Also for stackers that have no clue you need: (import java.awt.Toolkit) ...