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

``Caveat Utilitor''



Response to DLW's recent message to INFO-ZWEI:

     I would like to point out to all ZWEI users that this is the sort of
     bug you should expect to get if you start redefining things like
     KILL-BUFFER; that is, if you redefine things that are part of the set
     of primitive manipulations of editor data structures.  This is the Lisp
     Machine and so you are free to do what you want, but we do not
     guarantee that anything will work if you play with internals of the
     editor, and it is a bit annoying trying to act upon bugs that were
     really caused by such changes.  Please be careful.

While I certainly agree that users have to be responsible for their own
modifications to installed functions, I think it should also be
recognized that users have legitimate reasons for wanting to tailor
software to their own needs; and that the Lisp machine could do a bit
more to accomodate this than is currently done.  The problem is, of
course, that when an installed function has been replaced with a
variant, and then that installed function changes in later systems,
there is no easy way for a user to discover this.  I'd like to propose a
simple scheme that I've been thinking about for a while that is painless
and can keep users informed automatically of changes to specific
installed functions in future systems.

On the property list of (most or all) system-installed functions is an
OFFICIAL-VERSION-HASH property, an SXHASH of the EXPR code for the
particular function.  The property can be added with a minimum of work
by the compiler.  Users record the hash of the official version they are
replacing in their own files along with the replacement.  This could be
done conveniently by hand in the source code, or automatically if
someone sees a good way how.  In the user's source code would be
something like:

(OFFICIAL-VERSION-REPLACED 'ZWEI:KILL-BUFFER 12345678.)
(DEFUN ZWEI:KILL-BUFFER (...

with OFFICIAL-VERSION-REPLACED defined to check the hash property of the
currently installed version and compare it with the argument.  If they
differ an appropriate warning message is printed (possibly also giving
the source file for the official version).  Users then have the
opportunity to examine the official version and modify their own
versions appropriately.  When they are satisfied, the hash value in the
source can be updated to the hash of the then-official version.