Comment 2 for bug 1669030

Revision history for this message
James Kalenius (aeshtaer) wrote :

I've run into this myself. The problem isn't that find-class ignores the compilation environment, which is fine as stassats said, but that defclass doesn't have compile-time effects that it ought to. CLHS says

"If a defclass form appears as a top level form, the compiler must make the class name be recognized as a valid type name in subsequent declarations (as for deftype) and be recognized as a valid class name for defmethod parameter specializers and for use as the :metaclass option of a subsequent defclass. The compiler must make the class definition available to be returned by find-class when its environment argument is a value received as the environment parameter of a macro."

SBCL does make it known as a type, and allowed as a :metaclass, but it doesn't seem to exist as an actual class accessible by find-class. Doing so is obscure but pretty explicitly allowed, and works on e.g. ECL and CCL.