Worth the effort to make int-map and int-set sorted?

Description

I haven't looked at the implementation in detail yet to see what the issues would be, but it seems like perhaps guaranteeing that seq returns set elements / map keys in sorted numerical order might be easy.

Would that be something you would want to promise as part of the behavior of these data structures, or would that be too limiting for future implementation choices?

They are definitely not sorted today, e.g.:

Environment

None

Activity

Show:

Andy FingerhutJune 1, 2015 at 4:10 AM

I looked at it for a little while, but cannot say I have understood the change well enough to understand why it would or would not work. It seems to have the desired effect, so thanks for looking into it.

Zach TellmanMay 31, 2015 at 8:53 PM

Yes, very worth the effort. This was an oversight on my part, which I just fixed: https://github.com/clojure/data.int-map/commit/f023d08cb9853886a900a0bdd988d46958915bf5. I'll cut 0.2.1 soon, unless you see any issues with this.

Completed

Details

Assignee

Reporter

Priority

Created May 31, 2015 at 8:23 PM
Updated March 21, 2023 at 2:16 PM
Resolved September 27, 2016 at 5:14 PM