0

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?

Shlomi
  • 4,708
  • 1
  • 23
  • 32
Adam Rackis
  • 82,527
  • 56
  • 270
  • 393

0 Answers0