hrldcpr/pcollections

Linked maps

Closed this issue · 1 comments

From gromop...@gmail.com on 2013-03-16T10:40:59Z

I use maps a lot in my project, and the order of elements is really important for me. In JDK, I'd use LinkedHashMap, but I'd rather like a persistent analogue which pcollections doesn't have unfortunately.

Right now I've created a wrapper holding a HashTreePMap and a ConsPStack, where the latter reflects the element addition and iteration order. I'd appreciate if pcollections had such functionality out of the box.

It could be done as a separate class, e.g. LinkedTreePMap.
Or the cons-list could be directly embedded into HashTreePMap or IntTreePMap. Ideally it would be there always, but as it takes some memory, preserving the order could be made optional.

What do you think?

Original issue: http://code.google.com/p/pcollections/issues/detail?id=24

Fixed by #92