Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Typed persistent data structure a la Clojure, done in Java?

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

like image 240
Wilfred Springer Avatar asked Jun 14 '26 19:06

Wilfred Springer


2 Answers

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.)

like image 109
Wilfred Springer Avatar answered Jun 16 '26 09:06

Wilfred Springer


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

like image 31
mikera Avatar answered Jun 16 '26 10:06

mikera



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!