[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LISP-SYMBOL-REDEFINITION



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