[armedbear-devel] [closer-devel] Closer-mop support for ABCL

Pascal Costanza pc at p-cos.net
Sun Aug 26 17:17:32 UTC 2012


On 26 Aug 2012, at 18:58, Rudolf Schlatte <rudi at constantly.at> wrote:

> 
> On Aug 26, 2012, at 18:40, Pascal Costanza <pc at p-cos.net> wrote:
> 
> [...]
> 
>> However, the error message doesn't seem to make any sense:
>> 
>> Error loading /Users/costanza/lisp/develop/closer/contextl/test/demo3.lisp at line 51 (offset 1410)
>> #<THREAD "interpreter" {3ADE1520}>: Debugger invoked on condition of type TYPE-ERROR
>> The value 1 is not of type (INTEGER 0 1).
> 
> Ah, I copied the type-error-generating code from standard-instance-access which already implemented the bounds check, clearly the upper bound is mis-reported in both places.  Will fix.
> 
>> Restarts:
>> 0: TOP-LEVEL Return to top level.
>> [1] CX-USER(2): :bt
>> 
>> 0: (SYSTEM:BACKTRACE)
>> 1: (INVOKE-DEBUGGER #<TYPE-ERROR {4ADA1DC}>)
>> 2: org.armedbear.lisp.Lisp.error(Lisp.java:382)
>> 3: org.armedbear.lisp.Lisp.type_error(Lisp.java:423)
>> 4: org.armedbear.lisp.StandardObject$pf__set_standard_instance_access.execute(StandardObject.java:489)
>> 5: org.armedbear.lisp.Symbol.execute(Symbol.java:825)
>> 6: org.armedbear.lisp.LispThread.execute(LispThread.java:666)
>> 7: org.armedbear.lisp.clos_671.execute(clos.lisp:3409)
> 
> Frame 7 is from (setf slot-value-using-class); expanding the backtrace further will show where that one is called.


OK, class redefinition doesn't trigger the obsolete instance structure protocol correctly, it seems. Here is a transcript:

CL-USER(1): (defclass person () (name))
#<STANDARD-CLASS PERSON {1E631646}>
CL-USER(2): (defparameter *p* (make-instance 'person))
*P*
CL-USER(3): (setf (slot-value *p* 'name) "name")
"name"
CL-USER(4): (defclass person () (name address))
#<STANDARD-CLASS PERSON {1E631646}>
CL-USER(5): (use-package :mop)
T
CL-USER(6): (class-slots (find-class 'person))
(#<SYSTEM:SLOT-DEFINITION NAME {1A60232C}> #<SYSTEM:SLOT-DEFINITION ADDRESS {37A0B39B}>)
CL-USER(7): (setf (slot-value-using-class (find-class 'person) *p* (second *)) "address")
#<THREAD "interpreter" {43F31EDC}>: Debugger invoked on condition of type TYPE-ERROR
  The value 1 is not of type (INTEGER 0 1).
Restarts:
  0: TOP-LEVEL Return to top level.

The problematic part seems to be the use of slot-value-using-class here. With just slot-value, this works fine...

Pascal

--
Pascal Costanza







More information about the armedbear-devel mailing list