I have a Clojure project I created with lein new
. I have a junk.clj file with this
(ns myns.junk)
(defn sq [x] (* x x))
After loading the jar created by lein uberjar in my java project, I can import and call that function via
import myns.junk$sq;
public class JavaApplication1 {
public static void main(String[] args) {
System.out.println(junk$sq.invokeStatic(5));
}
}
My question is, is it possible to import that function more intelligently? Ie call it as a proper function, expecting an integer, and expecting to return an integer?