Implement NavigableMap interface or similar

Description

This allows one to find the nearest matching key if no exact match is found.

I'm implementing a decaying history collection.
I started out with Clojures sorted-map, mapping from revision to value.
However, it turns out that I need a fast way to delete the nth element.
So your AVL tree saves the day.

Except, it would be really nice that if someone looked up an old revision that has been decayed, I could serve them the nearest one instead.

I think it's pretty easy to implement at least that part of it. Just the terminal case of the lookup fn needs to be adjusted. The submap part might be more involved.

Environment

None

Attachments

5

Activity

Show:

Michał Marczyk March 23, 2014 at 12:43 AM

0.0.12-alpha1 is out.

Here's the announcement thread on the mailing list:

https://groups.google.com/d/msg/clojure/UBYwNRd956g/GVio8bpgWO4J

Michał Marczyk March 18, 2014 at 1:32 PM

Hey Pepijn, just wanted to let you know that your tests are now on master.

Michał Marczyk February 13, 2014 at 9:12 AM

I think subrange may become slice. (This whole naming issue is taking way too much time.)

Michał Marczyk February 3, 2014 at 1:20 AM

Just fixed a bug in split-at whereby the split point would effectively be shifted by one. Also, split-at and split-key now take the split point argument first to match core split-at and split-with. Finally, the new features are now documented in the README.

Michał Marczyk February 3, 2014 at 12:09 AM

Just pushed the ClojureScript port of the recent changes to master. Almost there now.

Completed

Details

Assignee

Reporter

Patch

Code and Test

Priority

Created January 6, 2014 at 12:22 PM
Updated August 23, 2016 at 7:22 PM
Resolved August 23, 2016 at 7:22 PM