On Jul 13, 2009, at 11:45 AM, Morgan Allen wrote:

The speed difference isn't the main thing- but I *was* under the
impression that the only way for java to communicate with clojure was
using AOT class compilation.

OK, cool. That is another benefit of AOT compilation. The primary use for :gen-class is when the Java side needs a class it can refer to explicitly by name. For other cases, a good way for Java to communicate with Clojure code is to use a proxy. On the Java side, you can define an Interface and on the Clojure side you can define a proxy that implements that interface by way of Clojure functions. There's a runtime performance cost to doing that, but you gain the ability to, for example, redefine any of the functions that implements the Interface methods and have the change be effective immediately.

Anyways, that's not a problem now-
http://en.wikibooks.org/wiki/Clojure_Programming/Tutorials_and_Tips#Invoking_Clojure_from_Java
But I don't think that was mentioned in the present 'java interop'
docs...

I think that's intentional. The docs at clojure.org present the supported, maintained, (and to the extent possible) guaranteed public interface to Clojure. Invoking Clojure from Java as presented on the wiki works, but it uses parts of the internal implementation of Clojure on the JVM that are not guaranteed to last forever. (However, if you stick to a particular version of Clojure, there would be very little chance of them changing.) Depending on your application of Clojure, you may want to use these internal implementation-aware methods now for convenience, avoid them by using other Clojure facilities like proxy or the socket repl, or if none of those are acceptable, describe what you're trying to do and what the constraints are and get more help here.

Is there some javadoc for the clojure.lang api that I could look over?

There is very little javadoc source in the clojure.lang source files. If you end up needing to understand those classes and can't get what you need by reading the source, asking here is probably your best bet.

I'll try taking a look at ant too.

Sounds good!

--Steve

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to