<< Back to previous view

[DPRIMAP-6] (empty ...) forgets the comparator Created: 05/Sep/13  Updated: 13/Nov/13  Resolved: 13/Nov/13

Status: Resolved
Project: data.priority-map
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Jamie Brandon Assignee: Mark Engelberg
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File dprimap-6-v1.txt    
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.

Generated at Sun Oct 04 12:04:20 CDT 2015 using JIRA 4.4#649-r158309.