Greetings,
Sometimes I forget not to call accessor methods FORMAT, TYPE etc.
> (defclass foo ()
((format :accessor format)))
Error: "FORMAT already names an ordinary function or a macro.".
> (defclass foo ()
((file-format :accessor file-format)))
Error: "FORMAT already names an ordinary function or a macro.".
I expected my redefinition to work, but apparently it doesn't. Is this
a bug, or just a case of "Don't do that then"?
Also, on a similar note,
> (defclass bar ()
((type :accessor type)))
debugger invoked on a SYMBOL-PACKAGE-LOCKED-ERROR in thread 20039:
Lock on package COMMON-LISP violated when setting fdefinition of TYPE.
[....]
restarts (invokable by number or by possibly-abbreviated name):
0: [CONTINUE ] Ignore the package lock.
1: [IGNORE-ALL ] Ignore all package locks in the context of this
operation.
2: [UNLOCK-PACKAGE] Unlock the package.
3: [ABORT ] Reduce debugger level (leaving debugger, returning to
toplevel).
4: [TOPLEVEL ] Restart at toplevel READ/EVAL/PRINT loop.
>:ABORT
> (defclass bar ()
((file-type :accessor file-type)))
Lock on package COMMON-LISP violated when setting fdefinition of TYPE.
Here I choose the :ABORT restart on the package-lock error, but I can
still can't redefine my BAR-class.
Is there a reason for the first type of mistake (with FORMAT) giving one
sort of error, but the other (with TYPE) giving another?
I'm using SBCL 0.8.19 with slime on RH9/x86.
Cheers.
Martin
|