Skip to content

Latest commit

 

History

History
3 lines (2 loc) · 1.22 KB

README.md

File metadata and controls

3 lines (2 loc) · 1.22 KB

This project provides a Java-friendly API to Clojure. It means that functions such as map, reduce, filter, partition, merge-with, conj, etc are available as static Java functions. They were written during the development of a Java version of Rich Hickey's ant colony simulation demo, so the functions available are mostly those that were needed for that demo. The Java versions of (some of) Clojure functions are available in src/main/java/som/jayway/cljava/Core.java. The Java version of 'ants.clj' is also available in this project, in src/main/java/som/jayway/cljava/Ants.java.

Clojure's concurrency mechanisms: var, atom, ref, and agent, as well as the persistent data structures, are written in Java and are available as Java APIs. However, most other functions are written in Clojure, and are not easily available from Java. Of course, if one wishes to write Clojure code, one does it best in Clojure. Or one might provide Clojure code as a file or a String, and evaluate it from Java. But if one insists in wanting to write only Java, but in a functional way, with the awesome concurrency mechanisms in Clojure, and the magical persistent data structures, then this project might be useful. If nothing else, it was a good learning experience.