views:

77

answers:

3

In particular an immutable List with a cons operation would be welcome.

A: 

There are multiple solutions posted in Cons’ing a List in Java. And immutability can be added with:

List l;
...
l = Collections.unmodifiableList(l);
Devon_C_Miller
A: 

Dug around a little bit longer. This library probably comes closest: http://functionaljava.googlecode.com/svn/artifacts/2.22/javadoc/index.html . I would imagine that it would be possible to use Clojure's collection classes directly, but I'm not sure if would feel all that natural. (And I don't necessarily need to 'transactional' behaviour.)

Wilfred Springer
A: 

I've written a bunch of persistent data structures in Java. My "PersistentList" is pretty close to what you want.

http://code.google.com/p/mikeralib/source/browse/trunk/Mikera/src/mikera/persistent/PersistentList.java

mikera