Don Geddis <[EMAIL PROTECTED]> writes:
> Eric Marsden <[EMAIL PROTECTED]> writes:
> > You can get CMUCL to ask you whether you really want to mess things up by
> > adding code like this to your CMUCL initialization file (or the site-init
> > file might be more appropriate for teaching purposes):
> >
> > ,----
> > | (defun redefining-function (function replacement)
> > | (declare (ignore replacement))
> > | (when (eq (symbol-package function) (find-package "COMMON-LISP"))
> > | (cerror "Redefine ~a anyway"
> > | "Attempt to change a function in the COMMON-LISP package."
> > | function)))
> > |
> > | (push 'redefining-function ext:*setf-fdefinition-hook*)
> > `----
>
> This seems like a really useful snippet of code.
Indeed.
However, it doesn't quite work for (setf ...) functions. For instance
(defstruct foo bar) leads to this error:
Type-error in KERNEL::OBJECT-NOT-SYMBOL-ERROR-HANDLER:
(SETF FOO-BAR) is not of type SYMBOL
Are there other cases where FUNCTION is not a symbol?
--helmut