Clojure

Ensure that PersistentTreeMap.empty() (and therefore PersistentTreeSet.empty()) retain the callee's comparator

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: Release 1.1
  • Component/s: None
  • Labels:
    None

Description

Currently:

user=> (-> (sorted-set-by (comparator >) 1 2 3) empty (into [1 2 3]))
#{1 2 3}

The above should evaluate to #{3 2 1} (the provided comparator is being dropped by the 'empty' call).

Activity

Hide
Assembla Importer added a comment -

richhickey said: Updating tickets (#127, #128, #129, #130)

Show
Assembla Importer added a comment - richhickey said: Updating tickets (#127, #128, #129, #130)
Hide
Assembla Importer added a comment -

devlinsf said: [file:aaAsAO7eer3R_eeJe5afGb]: This fixes empty to preserve a comparator

Show
Assembla Importer added a comment - devlinsf said: [file:aaAsAO7eer3R_eeJe5afGb]: This fixes empty to preserve a comparator
Hide
Assembla Importer added a comment -

devlinsf said: I had add a new arity for withMeta to PersistentTreeSet and PersistentTreeMap. This new form takes a comparator when creating a new value.

Show
Assembla Importer added a comment - devlinsf said: I had add a new arity for withMeta to PersistentTreeSet and PersistentTreeMap. This new form takes a comparator when creating a new value.
Hide
Assembla Importer added a comment -

chouser@n01se.net said: Sean, both the map and set already have constructors that include meta and comparator (via impl in the set case). I think you can just use those in the empty() methods.

Show
Assembla Importer added a comment - chouser@n01se.net said: Sean, both the map and set already have constructors that include meta and comparator (via impl in the set case). I think you can just use those in the empty() methods.
Hide
Assembla Importer added a comment -

devlinsf said: Rewrote empty per Chouser's suggestion. Removed new arity to withMeta. Added tests to test_clojure/sequences.clj Should be better now.

Show
Assembla Importer added a comment - devlinsf said: Rewrote empty per Chouser's suggestion. Removed new arity to withMeta. Added tests to test_clojure/sequences.clj Should be better now.
Hide
Assembla Importer added a comment -

chouser@n01se.net said: Sean, I don't see a new patch attached.

Show
Assembla Importer added a comment - chouser@n01se.net said: Sean, I don't see a new patch attached.
Hide
Assembla Importer added a comment -

chouser@n01se.net said: [file:bkb7eW7nWr3RUheJe5aVNr]: Simplified patch to fix sorted empty() methods

Show
Assembla Importer added a comment - chouser@n01se.net said: [file:bkb7eW7nWr3RUheJe5aVNr]: Simplified patch to fix sorted empty() methods
Hide
Assembla Importer added a comment -

chouser@n01se.net said: [file:camOJA7oOr3QIWeJe5aVNr]: patch against 1.1.0-rc1 that includes fix and tests

Show
Assembla Importer added a comment - chouser@n01se.net said: [file:camOJA7oOr3QIWeJe5aVNr]: patch against 1.1.0-rc1 that includes fix and tests
Hide
Assembla Importer added a comment -

chouser@n01se.net said: (In [[r:89ad4ab4265299327001e2717aa73c8f87f11346]]) empty for sorted-map and sorted-set now maintain comparator. Fixes #128

Signed-off-by: Rich Hickey <richhickey@gmail.com>

Branch: master

Show
Assembla Importer added a comment - chouser@n01se.net said: (In [[r:89ad4ab4265299327001e2717aa73c8f87f11346]]) empty for sorted-map and sorted-set now maintain comparator. Fixes #128 Signed-off-by: Rich Hickey <richhickey@gmail.com> Branch: master
Hide
Assembla Importer added a comment -

importer said: (In [[r:a3a1b3aa3523608f0b69e0d8655d519767246c79]]) Added sorted tests to test-empty in test_clojure/sequences.clj Refs #128

Signed-off-by: Rich Hickey <richhickey@gmail.com>

Branch: master

Show
Assembla Importer added a comment - importer said: (In [[r:a3a1b3aa3523608f0b69e0d8655d519767246c79]]) Added sorted tests to test-empty in test_clojure/sequences.clj Refs #128 Signed-off-by: Rich Hickey <richhickey@gmail.com> Branch: master
Hide
Assembla Importer added a comment -

importer said: (In [[r:855f394d6895cebfcee307dbccea9bdeffe792f5]]) Added test-empty-sorted to test_clojure/sequences.clj Refs #128

Signed-off-by: Rich Hickey <richhickey@gmail.com>

Branch: master

Show
Assembla Importer added a comment - importer said: (In [[r:855f394d6895cebfcee307dbccea9bdeffe792f5]]) Added test-empty-sorted to test_clojure/sequences.clj Refs #128 Signed-off-by: Rich Hickey <richhickey@gmail.com> Branch: master

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: