GNU bug report logs -
#75170
add-to-alist: new function
Previous Next
Full log
Message #175 received at 75170 <at> debbugs.gnu.org (full text, mbox):
Looking at Stefan Monnier's set of things to modify and
remember for unloading, I made a list of things to extend
and the syntax for doing so:
list (add-to-list OBJECT ELEMENT)
alist (add-to-alist OBJECT (KEY . VALUE))
plist (put OBJECT KEY VALUE)
hooks (add-hook OBJECT FUNCTION)
function (define-advice OBJECT ...)
Seeing these all together, I have the following observations:
Mostly these take the name of the object as a quoted symbol.
'define-advice' doesn't require the name to be quoted, and it
also has a name starting with "def", so the leading "def" is a
good clue as to whether you need to quote the object's name.
'add-to-alist' should look more like 'put' (3 args) and less
like 'add-to-list' (2 args): (add-to-alist ALIST KEY VALUE).
We should be consistent about whether there is a "to" in the
middle of the name. 'add-to-list' and 'add-to-alist' refer to
the set we are adding to, but 'add-hook' and 'define-advice'
refer to the thing we are adding. 'put' has no noun at all;
if we add a function that supports unloading, it might be
clearer to call it 'add-to-plist'.
< Stephen
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.