what's a good persistent collections framework for use in java?

前端 未结 13 1404
-上瘾入骨i
-上瘾入骨i 2020-12-01 06:39

By persistent collections I mean collections like those in clojure.

For example, I have a list with the elements (a,b,c). With a normal list, if I add d, my original

13条回答
  •  伪装坚强ぢ
    2020-12-01 07:00

    In the same vein as Cornelius Mund, Pure4J ports the Clojure collections into Java and adds Generics support.

    However, Pure4J is aimed at introducing pure programming semantics to the JVM through compile time code checking, so it goes further to introduce immutability constraints to your classes, so that the elements of the collection cannot be mutated while the collection exists.

    This may or may not be what you want to achieve: if you are just after using the Clojure collections on the JVM I would go with Cornelius' approach, otherwise, if you are interested in pursuing a pure programming approach within Java then you could give Pure4J a try.

    Disclosure: I am the developer of this

提交回复
热议问题