[armedbear-devel] Bug report: non-standard metaclass causes aberrant behaviour

William Hounslow hounslow at users.sourceforge.net
Fri Sep 27 12:30:15 UTC 2013


Dear maintainers

#1 a user-defined allocate-instance method is not called at all

#2 slot-missing is called with a slot-name of nil

#3 update-dependent is not being applied to its keyword arguments

Best regards

William

"1.2.1"
"Java_HotSpot(TM)_Client_VM-Oracle_Corporation-1.7.0_17-b02"
"x86-Windows_7-6.1"
;;;#1
CL-USER(2): (defclass quux-class (standard-class) ())
#<STANDARD-CLASS QUUX-CLASS {D2A36B}>
CL-USER(3): (defmethod allocate-instance :after ((class quux-class) 
&rest initargs)
(format t "allocated ~S~%" class))
#<STANDARD-METHOD ALLOCATE-INSTANCE :AFTER (QUUX-CLASS) {14A0B92}>
CL-USER(4): (defclass quux nil (bar) (:metaclass quux-class))
#<QUUX-CLASS QUUX {50039B}>
CL-USER(5): (make-instance *)
#<QUUX {B2D899}>
CL-USER(6): (inspect (fdefinition 'allocate-instance))
    0 LAYOUT -----------> #<LAYOUT {BEF803}>
    1 NAME -------------> ALLOCATE-INSTANCE
    2 LAMBDA-LIST ------> (CLASS &REST ...)
    3 REQUIRED-ARGS ----> (CLASS)
    4 OPTIONAL-ARGS ----> NIL
    5 INITIAL-METHODS --> NIL
    6 METHODS ----------> (#<STANDARD-METHOD ALLOCATE-INSTANCE :AFTER 
(QUUX-CLASS) {14A0B92}> #<STANDARD-METHOD ALLOCATE-INSTANCE :BEFORE 
(CLASS) {18C9692}> ...)
    7 METHOD-CLASS -----> #<STANDARD-CLASS STANDARD-METHOD {A801B0}>
    8 %METHOD-COMBINATION -> #<METHOD-COMBINATION STANDARD {F167BB}>
    9 ARGUMENT-PRECEDENCE-ORDER -> (CLASS)
   10 DECLARATIONS -----> NIL
   11 CLASSES-TO-EMF-TABLE -> #<EQUAL HASH-TABLE 0 entries, 11 buckets 
{D15EE4}>
   12 %DOCUMENTATION ---> NIL
;;;#2
CL-USER(11): (make-instance 'quux)
#<QUUX {F2AE7E}>
CL-USER(12): (slot-value * 'baz)
#<THREAD "interpreter" {1A2FE4D}>: Debugger invoked on condition of type 
SIMPLE-ERROR
   The slot NIL is missing from the class #<QUUX-CLASS QUUX {50039B}>.
Restarts:
   0: TOP-LEVEL Return to top level.
;;;#3
CL-USER(2): (defclass foo-class (standard-class) ())
#<STANDARD-CLASS FOO-CLASS {14A123F}>
CL-USER(3): (defclass foo-dep () ())
#<STANDARD-CLASS FOO-DEP {145B486}>
CL-USER(4): (defmethod mop:update-dependent ((class foo-class) (dep 
foo-dep) &key direct-slots &allow-other-keys))
#<STANDARD-METHOD MOP:UPDATE-DEPENDENT (FOO-CLASS FOO-DEP) {155388B}>
CL-USER(5): (defclass foo () (bar) (:metaclass foo-class))
#<FOO-CLASS FOO {25D10A}>
CL-USER(6): (mop:add-dependent * (make-instance 'foo-dep))
(#<FOO-DEP {F167BB}>)
CL-USER(7): (trace mop:update-dependent)
(MOP:UPDATE-DEPENDENT)
CL-USER(8): (defclass foo () (bar baz) (:metaclass foo-class))
   0: (MOP:UPDATE-DEPENDENT #<FOO-CLASS {25D10A}> #<FOO-DEP {F167BB}> 
(:DIRECT-SUPERCLASSES NIL :DIRECT-SUPERCLASSES NIL DIRECT-SLOTS ((:NAME 
BAR) (:NAME BAZ))))
#<THREAD "interpreter" {886140}>: Debugger invoked on condition of type 
PROGRAM-ERROR
   Odd number of keyword arguments.
Restarts:
   0: TOP-LEVEL Return to top level.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/armedbear-devel/attachments/20130927/74b167b1/attachment.html>


More information about the armedbear-devel mailing list