[Ecls-list] Package locks and symbol-package

Matthew Mondor mm_lists at pulsar-zone.net
Tue Oct 9 23:55:52 UTC 2012


Is the following behaviour intentional?  I realize that it must be
implementation-dependent, although I noticed these differences between


(make-package :foo) -> #<"FOO" package>
(defparameter foo::gentemp 10) -> GENTEMP
(symbol-package 'foo::gentemp) -> #<"COMMON-LISP" package>

On SBCL, SYMBOL-PACKAGE here reports the FOO package.

Resuting from this, SBCL also allows DEFUN or (SETF (SYMBOL-FUNCTION
'FOO::GENTEMP) #'(LAMBDA ...) without issueing a lock error, and this
seems sane, since the package is in FOO and FOO does not USE-PACKAGE CL.

ECL reports that the symbol is part of COMMON-LISP even if that package
doesn't :USE :CL, however, and a package locked error is issued if
attempting to define a function on a symbol which exists in the
COMMON-LISP package, even if the symbol is really another symbol of the
same name that's in the FOO package and is not inherited.

Of course, SBCL will issue a package locked error in the case where the
FOO package USEs CL.


More information about the ecl-devel mailing list