Activity log for bug #310120

Date Who What changed Old value New value Message
2008-12-21 01:06:35 James Y Knight bug added bug
2008-12-21 01:11:05 Nikodemus Siivola title ansi compliance bug in defclass defclass doesn't inform TYPEP in the compilation environment (because we don't have a compilation environment)
2008-12-21 01:11:29 Nikodemus Siivola sbcl: status New Confirmed
2008-12-21 01:11:29 Nikodemus Siivola sbcl: importance Undecided Medium
2008-12-21 01:11:29 Nikodemus Siivola sbcl: statusexplanation
2008-12-21 01:12:25 Nikodemus Siivola description Version: 1.0.23 Platform: linux x86-64 Originally reported to me by Mark Nahabedian. Put this in a file: > (in-package :cl-user) > > (defclass foo () > ((foo1) (foo2))) > > (defmacro foobie-doo (&environment env class-name) > (let ((class (find-class class-name t env))) > `(progn > ,class))) > > (print (foobie-doo foo)) Then: * (compile-file "/tmp/test.lisp") debugger invoked on a SIMPLE-ERROR in thread #<THREAD "initial thread" RUNNING {1002740F11}>: There is no class named FOO. restarts (invokable by number or by possibly-abbreviated name): 0: [ABORT] Exit debugger, returning to top level. (SB-PCL::FIND-CLASS-FROM-CELL FOO NIL T) 0] But the CommonLisp spec (see "Macro DEFCLASS") 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. Version: 1.0.23 Platform: linux x86-64 Originally reported to me by Mark Nahabedian. Put this in a file: > (in-package :cl-user) > > (defclass foo () > ((foo1) (foo2))) > > (defmacro foobie-doo (&environment env class-name) > (let ((class (find-class class-name t env))) > `(progn > ,class))) > > (print (foobie-doo foo)) Then: * (compile-file "/tmp/test.lisp") debugger invoked on a SIMPLE-ERROR in thread #<THREAD "initial thread" RUNNING {1002740F11}>: There is no class named FOO. restarts (invokable by number or by possibly-abbreviated name): 0: [ABORT] Exit debugger, returning to top level. (SB-PCL::FIND-CLASS-FROM-CELL FOO NIL T) 0] But the CommonLisp spec (see "Macro DEFCLASS") 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. See also bug 309140.
2018-10-30 16:51:23 Nicolas Hafner bug added subscriber Nicolas Hafner