Skip to content

ulsa/cljava

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

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.

About

Clojure Java API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published