GNU bug report logs -
#75170
add-to-alist: new function
Previous Next
Full log
View this message in rfc822 format
I don't have much to add to this discussion except:
- I personally dislike `add-to-list` because I think that conflating
symbols with variables is a bad practice (e.g. because it is
incompatible with lexical scoping).
- Yet, it works OK for configuration, which always involves
global/dynamic variables anyway, and where `push` is not great and
`cl-pushnew` often requires `:test #'equal`.
- I think we should try and provide better support (in general) for
unloading packages, and this means improving support for undoing
top-level operations. We currently support `defalias` and friends
fairly well, `defvar` and friends tolerably, but we fail miserably for
most other things. So maybe something like an `add-to-alist` dedicated
to top-level operations, which records the change somewhere
(e.g. `load-history`) so we can undo it when unloading, would be
an improvement. Of course it would make a lot of sense to do it
together with similar operations to add an element to a list, to add
a property to a symbol, to add an advice, to add a function on a hook,
... so it's probably worth thinking of a more general way to provide
those operations than doing it one at a time.
- Stefan
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.