[DPRIMAP-6] (empty ...) forgets the comparator Created: 05/Sep/13 Updated: 13/Nov/13 Resolved: 13/Nov/13
|Reporter:||Jamie Brandon||Assignee:||Mark Engelberg|
|Patch:||Code and Test|
The current implementation is:
(empty [this] pm-empty)
It should be:
(empty [this] (pm-empty-by (.comparator priority->set-of-items)))
This allows eg:
(into (empty pm) (filter f pm))
It also ensures that clojure.walk works correctly.
|Comment by Andy Fingerhut [ 07/Sep/13 8:06 PM ]|
Patch dprimap-6-v1.txt adds tests to verify that empty preserves not only the comparator, but also the metadata of the priority map. empty preserves the metadata of all other Clojure collections for which it is implemented.
It also modifies empty to pass these new tests.
|Comment by Andy Fingerhut [ 13/Nov/13 3:41 PM ]|
Mark Engelberg independently discovered and fixed this issue some time ago.