assoc-utils
assoc-utils copied to clipboard
Suggestion: Use stable-sort in alist=
It is common practice to have multiple entries in an alist with the same key. E.g. CLtL2 explicitly touts this as a feature:
Moreover, because the searching function assoc searches the a-list in order, new entries can ``shadow'' old entries
The order of keys should thus be maintained in alist=
, otherwise this function might e.g. return non-nil for '(("foo" . 1) ("foo" . 2))
and '(("foo" . 2) ("foo" . 1))
.
@epipping could you please provide a test which will break because the sort is not stable?