Re: Best practice for calling Clojure from Java

2016-05-02 Thread Patrick Martin
Great - thanks for the tips! My gist example was applying the 1.6 Clojure API, but I was not sure if anything has evolved through 1.7 and 1.8. I will check out the Tapestry approach. I like the idea of mapping an interface to a namespace. Patrick On Monday, May 2, 2016 at 1:18:47 AM UTC-4, How

Re: Best practice for calling Clojure from Java

2016-05-01 Thread Howard Lewis Ship
You can also look into this: http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/clojure/package-summary.html It's an extension to the Tapestry 5 IoC container that allow you to map an interface to a Clojure namespace. You define the Java interface and supply a mapping, via naming con

Re: Best practice for calling Clojure from Java

2016-05-01 Thread Timothy Baldridge
Ah apparently someone also added a section to the docs on it: http://clojure.org/reference/java_interop#_calling_clojure_from_java On Sun, May 1, 2016 at 7:06 PM, Timothy Baldridge wrote: > Take a look at this class: > https://github.com/clojure/clojure/blob/master/src/jvm/clojure/java/api/Cloju

Re: Best practice for calling Clojure from Java

2016-05-01 Thread Timothy Baldridge
Take a look at this class: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/java/api/Clojure.java It was added in Clojure 1.6 exactly for this use-case, and will be quite fast, especially if you store the vars somewhere and only look them up once. Timothy On Sun, May 1, 2016 at 6:28