GNU bug report logs -
#75170
add-to-alist: new function
Previous Next
Full log
View this message in rfc822 format
On Mon, Jan 20 2025, Robert Pluim wrote:
> Iʼm not sure what this would offer over
>
> (setf (alist-get key alist) value)
>
> which will add a key->value mapping if it doesnʼt exist, and replace
> it if it does. I also donʼt see a real use for retaining the existing
> mapping: `alist-get' will return the first one anyway.
By now, this approach has been proposed in this thread a few times.
The question is: this uses the concept of generalized variables.
Is this a concept we recommend to users for their init files?
To the best of my knowledge, previously this has not been the case.
I am tempted to argue that in our recommendations what users should
do in their init files, we should stick to strategies that are as
simple and transparent as possible, and the above does not match
that criterion. A collection of functions we recommend to users for
their init files might be a good thing. add-to-list already serves
that specific purpose, and add-to-alist could be another one.
Roland
This bug report was last modified 143 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.