[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Undoing global side-effects
- To: navajo!Common-Lisp@SAIL
- Subject: Undoing global side-effects
- From: email@example.com (Eric Benson)
- Date: Sat, 14 Dec 85 17:40:07 pst
I went through the Common Lisp manual looking for functions which have
global side-effects and came up with the following list, along with
suggested functions for removing those side effects:
These should all be undoable by MAKUNBOUND and an UNSPECIAL
proclamation. UNSPECIAL should be restricted to use in PROCLAIM and not
allowed in DECLARE. This will prevent a major incompatible change in
DELETE-CONSTANT should make a symbol unbound, unspecial and
inconstant (yes, it's a real English word).
SETF of SYMBOL-FUNCTION
SETF of MACRO-FUNCTION
These are undone by FMAKUNBOUND. In some implementations, DEFUN and
DEFMACRO record information other than the function definition. Since
this is outside the scope of Common Lisp, the language standard need not
include a way to undo it.
These are undone by the DELETE-SETF-METHOD function previously
The DELETE-TYPE function should undo this. It should signal an error
if any other type is a subtype of the specified type. It "is an error"
to DELETE-TYPE any of the built-in Common Lisp types.
There ought to be a DELETE-DEFSTRUCT function which undoes all the
effects of the DEFSTRUCT, by removing all function definitions
(including compiler database entries for inline compilation), removing
any type database entry, removing the :PRINT-FUNCTION entry, and
removing any information from DEFSTRUCT's own database (that which
allows a name to be used in the :INCLUDE option). It should signal an
error if any other structure type has :INCLUDEd the given type (unless
that structure type has also been deleted).
This is undone by the DELETE-PACKAGE function previously described.
Document the fact that SHADOW can be undone by UNINTERN, causing any
otherwise inherited symbol to become accessible again.
SETF of DOCUMENTATION
These should all be undoable by using NIL as the new value. This must
Thus there are five new functions
and one new proclamation, UNSPECIAL. It doesn't seem to me to be worth
inventing some new SETF-like meta-deletion macro to handle these. If we
like this naming convention it might a good idea to add the names
DELETE-VALUE and DELETE-FUNCTION as synonyms for MAKUNBOUND and
FMAKUNBOUND, eventually phasing out the latter names.