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:
Arguably the new behaviour is more natural, however this is a regression from prior behavior.
Proposed: Restore the original behavior and update docstring.
Screened by: Alex Miller
Restoring the original behaviour (option 2) seems like a reasonable default position, particularly so close to a major release, so here's a patch that does that.
As a side note, the original behaviour arose from the use of reduce in the implementation of both functions:
Agreed on restoring original behavior.
I also think that the expected behaviour should be mentioned in the documentation, as I'd certainly expect this to behave like it does after the patch. Perhaps down the road we can make this configurable with an extra parameter?
That's fair enough re: documenting the behaviour. Here's a patch that applies on top of the 0001 patch and only tweaks the docstrings by adding "If there are multiple such xs, the last one is returned."
Driving the behaviour using extra arguments is not really an option in this case, as min-key and max-key take varargs.
An extra pair of functions along the lines of min-key-first / max-key-first could be contemplated (as could min-key-last / max-key-last to provide a migration path for existing users if the new behaviour were kept). Whether it should is a separate question which it may be ok to address after the release.