Subject: bug#75170: add-to-alist: new function

From: Drew Adams <[email-masked]>
Date: Tue, 21 Jan 2025 20:57:28 +0000

> > add-to-alist checks for the presence of keys and it makes sure that each
> > key appears only once in an alist.

FWIW -

That's not an alist.  At least it doesn't fit
with a common use of alists.  It fits with
hash tables and similar constructs.

One of the benefits of alists is the ability
to have multiple entries with the same key,
with the first, for most purposes, shadowing
the rest.

Another use case is multiple entries with
keys that are identical for some equality
tests but not for others.  "All animals are
equal, but some are more equal than others."
___

(Not saying other things you've written are
mistaken, or that it's not a good idea to
think about an `add-to-alist' function.
Just saying that entries with equal keys
are not something to be automatically
removed from alists, in general.)