GNU bug report logs - #75170
add-to-alist: new function

Previous Next

Package: emacs;

Reported by: Roland Winkler <winkler <at> gnu.org>

Date: Sun, 29 Dec 2024 05:35:02 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: Drew Adams <drew.adams <at> oracle.com>
To: Roland Winkler <winkler <at> gnu.org>, Eli Zaretskii <eliz <at> gnu.org>
Cc: "acorallo <at> gnu.org" <acorallo <at> gnu.org>, "rpluim <at> gmail.com" <rpluim <at> gmail.com>, "75170 <at> debbugs.gnu.org" <75170 <at> debbugs.gnu.org>, Stefan Kangas <stefankangas <at> gmail.com>, "monnier <at> gnu.org" <monnier <at> gnu.org>
Subject: bug#75170: add-to-alist: new function
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.)





This bug report was last modified 142 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.