From rudi at constantly.at Wed Sep 5 10:33:29 2012 From: rudi at constantly.at (Rudolf Schlatte) Date: Wed, 5 Sep 2012 12:33:29 +0200 Subject: [closer-devel] Closer-mop support for ABCL In-Reply-To: References: <49D4C326-A8F4-4EFA-8FFE-CCAEE76838BD@constantly.at> <9447CD68-89C1-40A5-855E-53E31198DAD3@constantly.at> <89F50AB4-ECCC-4DA9-B1CC-4E8E99D63DD4@constantly.at> <1E0755AE-705E-4284-8202-A58915D37804@p-cos.net> <9DF3873F-9C89-45A7-8D93-FA9BAAEF7266@constantly.at> <56959ADD-FFE5-418B-A95C-15C4B2C9F7DF@p-cos.net> <326F705A-A940-4FCE-A264-69137AD68DB7@constantly.at> Message-ID: On Aug 26, 2012, at 22:37, Pascal Costanza wrote: > OK, on to the next bug: It seems that anonymous classes are always considered subtypes of other classes. This is not correct. Here is transcript: > > CL-USER(1): (defparameter *c1* (make-instance 'standard-class)) > *C1* > CL-USER(2): (defparameter *c2* (make-instance 'standard-class)) > *C2* > CL-USER(3): (subtypep *c1* *c2*) > T > T [etc] Nice. For more fun and games, consider (setf (class-name *c1*) t) - instant universal superclass. Anyway, both issues are hopefully fixed now. I wonder if this should be added to ansi-tests. Rudi From pc at p-cos.net Sun Sep 9 16:46:20 2012 From: pc at p-cos.net (Pascal Costanza) Date: Sun, 9 Sep 2012 18:46:20 +0200 Subject: [closer-devel] Closer-mop support for ABCL In-Reply-To: References: <49D4C326-A8F4-4EFA-8FFE-CCAEE76838BD@constantly.at> <9447CD68-89C1-40A5-855E-53E31198DAD3@constantly.at> <89F50AB4-ECCC-4DA9-B1CC-4E8E99D63DD4@constantly.at> <1E0755AE-705E-4284-8202-A58915D37804@p-cos.net> <9DF3873F-9C89-45A7-8D93-FA9BAAEF7266@constantly.at> <56959ADD-FFE5-418B-A95C-15C4B2C9F7DF@p-cos.net> <326F705A-A940-4FCE-A264-69137AD68DB7@constantly.at> Message-ID: <05FC3EB8-EA78-4F0D-B2A2-61852B3A4449@p-cos.net> On 5 Sep 2012, at 12:33, Rudolf Schlatte wrote: > On Aug 26, 2012, at 22:37, Pascal Costanza wrote: > >> OK, on to the next bug: It seems that anonymous classes are always considered subtypes of other classes. This is not correct. Here is transcript: >> >> CL-USER(1): (defparameter *c1* (make-instance 'standard-class)) >> *C1* >> CL-USER(2): (defparameter *c2* (make-instance 'standard-class)) >> *C2* >> CL-USER(3): (subtypep *c1* *c2*) >> T >> T > > [etc] > > Nice. For more fun and games, consider (setf (class-name *c1*) t) - instant universal superclass. Anyway, both issues are hopefully fixed now. > > I wonder if this should be added to ansi-tests. This would probably make sense. On to the next bug: CL-USER(1): (use-package :mop) T CL-USER(2): (defclass my-class (standard-class) ()) # CL-USER(3): (defmethod slot-unbound ((class my-class) object slot) (print :foo) (call-next-method)) # CL-USER(4): (defclass test () ((slot :accessor test-slot)) (:metaclass my-class)) # CL-USER(8): (make-instance 'test) # CL-USER(9): (slot-boundp * 'slot) T CL-USER(10): (test-slot **) :FOO #: Debugger invoked on condition of type UNBOUND-SLOT The slot SLOT is unbound in the object #. Restarts: 0: TOP-LEVEL Return to top level. It seems that as soon as a method on slot-unbound is defined, slot-boundp returns t no matter whether the slot is bound or not. This should not be the case. Another issue that I'm currently fighting with is initialization of class slots for classes for which I never create any instances: (defclass test () ((slot :initform 42 :allocation :class))) (slot-value (class-prototype (find-class 'test)) 'slot) will report an unbound slot. This is probably defensible based on the HyperSpec and the CLOS MOP specification, but I doubt its useful. I believe that class slots should be initialized in finalize-inheritance the latest, and not only in shared-initialize on instances, to be useful for such scenarios. (But it's fine if you disagree, then I have to live with that and find a different solution?) Pascal -- Pascal Costanza The views expressed in this email are my own, and not those of my employer. From rudi at constantly.at Wed Sep 19 14:47:35 2012 From: rudi at constantly.at (Rudolf Schlatte) Date: Wed, 19 Sep 2012 16:47:35 +0200 Subject: [closer-devel] Closer-mop support for ABCL In-Reply-To: <05FC3EB8-EA78-4F0D-B2A2-61852B3A4449@p-cos.net> References: <49D4C326-A8F4-4EFA-8FFE-CCAEE76838BD@constantly.at> <9447CD68-89C1-40A5-855E-53E31198DAD3@constantly.at> <89F50AB4-ECCC-4DA9-B1CC-4E8E99D63DD4@constantly.at> <1E0755AE-705E-4284-8202-A58915D37804@p-cos.net> <9DF3873F-9C89-45A7-8D93-FA9BAAEF7266@constantly.at> <56959ADD-FFE5-418B-A95C-15C4B2C9F7DF@p-cos.net> <326F705A-A940-4FCE-A264-69137AD68DB7@constantly.at> <05FC3EB8-EA78-4F0D-B2A2-61852B3A4449@p-cos.net> Message-ID: <021994ED-8F42-4F52-AF63-C055AB76ED6E@constantly.at> On Sep 9, 2012, at 18:46, Pascal Costanza wrote: > > Another issue that I'm currently fighting with is initialization of class slots for classes for which I never create any instances: > > (defclass test () > ((slot :initform 42 :allocation :class))) > > (slot-value (class-prototype (find-class 'test)) 'slot) will report an unbound slot. This is probably defensible based on the HyperSpec and the CLOS MOP specification, but I doubt its useful. I believe that class slots should be initialized in finalize-inheritance the latest, and not only in shared-initialize on instances, to be useful for such scenarios. (But it's fine if you disagree, then I have to live with that and find a different solution?) I'm a bit slow with the fixes these days, but this should now be implemented in r14153. Note that the related form (defclass test () ((slot :initarg :slot :allocation :class)) (:default-initargs :slot 42)) currently still has the old behavior (unbound slot until the first instance is created). Do you think this should be fixed as well? Rudi From rudi at constantly.at Wed Sep 19 19:02:07 2012 From: rudi at constantly.at (Rudolf Schlatte) Date: Wed, 19 Sep 2012 21:02:07 +0200 Subject: [closer-devel] Closer-mop support for ABCL In-Reply-To: <05FC3EB8-EA78-4F0D-B2A2-61852B3A4449@p-cos.net> References: <49D4C326-A8F4-4EFA-8FFE-CCAEE76838BD@constantly.at> <9447CD68-89C1-40A5-855E-53E31198DAD3@constantly.at> <89F50AB4-ECCC-4DA9-B1CC-4E8E99D63DD4@constantly.at> <1E0755AE-705E-4284-8202-A58915D37804@p-cos.net> <9DF3873F-9C89-45A7-8D93-FA9BAAEF7266@constantly.at> <56959ADD-FFE5-418B-A95C-15C4B2C9F7DF@p-cos.net> <326F705A-A940-4FCE-A264-69137AD68DB7@constantly.at> <05FC3EB8-EA78-4F0D-B2A2-61852B3A4449@p-cos.net> Message-ID: On Sep 9, 2012, at 18:46, Pascal Costanza wrote: [...] > On to the next bug: > > CL-USER(1): (use-package :mop) > T > > CL-USER(2): (defclass my-class (standard-class) ()) > # > > CL-USER(3): (defmethod slot-unbound ((class my-class) object slot) (print :foo) (call-next-method)) > # > > CL-USER(4): (defclass test () ((slot :accessor test-slot)) (:metaclass my-class)) > # > > CL-USER(8): (make-instance 'test) > # > > CL-USER(9): (slot-boundp * 'slot) > T > > CL-USER(10): (test-slot **) > > :FOO > #: Debugger invoked on condition of type UNBOUND-SLOT > The slot SLOT is unbound in the object #. > Restarts: > 0: TOP-LEVEL Return to top level. > > It seems that as soon as a method on slot-unbound is defined, slot-boundp returns t no matter whether the slot is bound or not. This should not be the case. It's simpler than that - slot-boundp-using-class was just utterly broken for classes with non-standard metaclass. r14154 has the embarrassing details. Rudi