We're updating the issue view to help you get more done. 

{min,max}-key return first match in >= 1.9.0-alpha20, used to return the last one

Description

The fix, first included in 1.9.0-alpha20, changes behaviour of min-key and max-key to return the first argument among those with the minimum/maximum key, whereas in previously they both returned the last matching argument:

1 2 3 Clojure 1.9.0-alpha19 user=> (apply min-key :x [{:x 1000} {:x 1001} {:x 1002} {:x 1000 :second true}]) {:x 1000, :second true}
1 2 3 Clojure 1.9.0-beta1 user=> (apply min-key :x [{:x 1000} {:x 1001} {:x 1002} {:x 1000 :second true}]) {:x 1000}

Arguably the new behaviour is more natural, however this is a regression from prior behavior.

Proposed: Restore the original behavior and update docstring.
Patch: 0002-CLJ-2247-document-last-match-semantics-of-min-max-ke.patch
Screened by: Alex Miller

Environment

None

Status

Assignee

Unassigned

Reporter

Michał Marczyk

Labels

Approval

Ok

Patch

Code

Fix versions

Affects versions

Release 1.9

Priority

Major