Poiché le vararg Java sono actually arrays, è possibile chiamare le funzioni vararg in Clojure passando una matrice.
Si potrebbe convertire un ss Clojure (forse utilizzando varietà di funzioni di argomenti variabili di Clojure) in un array:
(TestClass/aStaticFunction (into-array Integer [(int 1),(int 2)]))
o
(defn a-static-function-wrapper [& args]
(TestClass/aStaticFunction (into-array Integer args))
o fare un array e impostare i suoi indici manualmente
(TestClass/aStaticFunction (doto (make-array Integer 3)
(aset 0 first-element)
(aset 1 second-element)
(aset 2 third-element)))
fonte
2012-07-28 15:28:16
possibile duplicato di [Implementare un metodo di interfaccia Java con un numero variabile di argomenti in Clojure] (http://stackoverflow.com/questions/9103777/implement-a-java-interface-method-with-a -variabile-numero-di-args-in-clojure) – Jeremy