Calling clojure from java

Update: Since this answer was posted, some of the tools available have changed. After the original answer, there is an update including information on how to build the example with current tools. It isn’t quite as simple as compiling to a jar and calling the internal methods. There do seem to be a few tricks … Read more

How to bundle a native library and a JNI library inside a JAR?

It is possible to create a single JAR file with all dependencies including the native JNI libraries for one or more platforms. The basic mechanism is to use System.load(File) to load the library instead of the typical System.loadLibrary(String) which searches the java.library.path system property. This method makes installation much simpler as the user does not … Read more

Why exactly is eval evil?

There are several reasons why one should not use EVAL. The main reason for beginners is: you don’t need it. Example (assuming Common Lisp): EVALuate an expression with different operators: (let ((ops ‘(+ *))) (dolist (op ops) (print (eval (list op 1 2 3))))) That’s better written as: (let ((ops ‘(+ *))) (dolist (op ops) … Read more