[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
LISP-SYMBOL-REDEFINITION
- To: masinter.pa@Xerox.COM
- Subject: LISP-SYMBOL-REDEFINITION
- From: Jim McDonald <jlm@lucid.com>
- Date: Sun, 18 Sep 88 13:41:25 PDT
- Cc: cl-cleanup@Sail.stanford.edu, unido!ztivax!kolb@seismo.CSS.GOV
- In-reply-to: masinter.pa@Xerox.COM's message of 17 Sep 88 15:02 PDT <880917-150250-2427@Xerox>
Instead of disallowing all symbols in the lisp package, why not have a
global registry (list, hash-table, etc.) of symbols whose redefinition
is disallowed, initialized in an implementation-specific manner to any
superset of the symbols in the lisp package? This has two advantages:
(1) Users would have a simple mechanism to protect their own
definitions, e.g.
(SETF (GETHASH 'MY-CAR *REDEFINTIONS-RESTRICTED*) T)
or with a more elaborate mechanism:
(SETF (GETHASH 'MY-CAR *REDEFINTION-RESTRICTIONS*)
'((:TRACE :ALLOWED) (:DEFVAR :ALLOWED) (:OTHERWISE :FORBIDDEN)))
(2) By temporarily removing a symbol from the registry you could enable
it for redefinition (e.g., while patching bugs or experimenting).
I also think the behavior of TRACE could be constrained somewhat more
than is stated. E.g., TRACE could be explicitly required to avoid
introducing infinite loops or recursions into standard CL functions,
if necessary by failing to trace certain functions. TRACE could also
be required to indicate to the user when functions in the registry are
being traced. But perhaps this is just common sense and/or purely
environmental issues...
jlm