Redefining structure accessors (summary)

Helmut Eller heller at common-lisp.net
Tue Mar 16 23:06:03 CET 2010


* Raymond Toy [2010-03-16 21:48+0100] writes:

> Actually, there's one other alternative.   When the accessor is
> redefined, we can silently (or noisily) replace the dsd-accessor
> function with nil.  Then we don't get the strange behavior of our
> redefined function being used to access the slot.   This also means we
> can't actually access the slot ourselves either because we'll try to get
> the fdefinition of nil.  But the structure and everything else remains
> defined.
>
> (I have not tried that out yet.)

If it works, good.

> I also notice that you can redefine the structure predicate without
> warning.  Perhaps we should warn about this too.

Possibly.  At least typep is smart enough not to call the predicate name
and still works if the predicate was redefined.

Helmut




More information about the cmucl-imp mailing list