[CLJ-1320] min-key assumes numbers, not comparables. Created: 09/Jan/14 Updated: 10/Jul/15 Resolved: 09/Jan/14
|Affects Version/s:||Release 1.2, Release 1.3, Release 1.4, Release 1.5, Release 1.6|
The min-key function assumes the key-fn will yield a number and thus uses the '<' operator to compare results.
While (first (sort-by key-fn seq)) could also be used, it feels more natural for min-key to use comparables.
|Comment by Pierre-Yves Ritschard [ 09/Jan/14 3:18 PM ]|
As discussed on the .L, since compare is slower it makes more sense to keep min-key as-is.
|Comment by Michael Blume [ 10/Jul/15 6:15 PM ]|
Instead of changing min-key, would it make sense to have a different function which takes a comparator instead of a key function?