[armedbear-devel] bug with initialize-instance and keyword arguments

Steve Rolls srolls24 at gmail.com
Fri Sep 25 20:58:31 UTC 2009


This is present in 0.16 and latest from svn, but not in 0.15. Specifying 
a keyword arg in an initialize-instance method does not make the keyword 
a valid initarg for make-instance.

Armed Bear Common Lisp 0.16.0
Java 1.6.0_12 Sun Microsystems Inc.
Java HotSpot(TM) 64-Bit Server VM
Low-level initialization completed in 0.425 seconds.
Startup completed in 2.086 seconds.
Type ":help" for a list of available commands.
CL-USER(1): (defclass c1() (x))
#<STANDARD-CLASS C1 {5A347448}>
CL-USER(2): (defmethod initialize-instance :after ((c c1) &key x2) (setf 
(slot-value c 'x) x2))
#<STANDARD-METHOD INITIALIZE-INSTANCE :AFTER (C1) {79A1EA46}>
CL-USER(3): (make-instance 'c1 :x2 1)
Debugger invoked on condition of type PROGRAM-ERROR:
  Invalid initarg :X2.
Restarts:
  0: TOP-LEVEL Return to top level.
[1] CL-USER(4):



Works as expected in 0.15

Armed Bear Common Lisp 0.15.0
Java 1.6.0_12 Sun Microsystems Inc.
Java HotSpot(TM) 64-Bit Server VM
Low-level initialization completed in 0.45 seconds.
Startup completed in 2.021 seconds.
Type ":help" for a list of available commands.
CL-USER(1): (defclass c1() (x))
#<STANDARD-CLASS C1 {615E7597}>
CL-USER(2): (defmethod initialize-instance :after ((c c1) &key x2) (setf 
(slot-value c 'x) x2))
#<STANDARD-METHOD INITIALIZE-INSTANCE :AFTER (C1) {7346B111}>
CL-USER(3): (make-instance 'c1 :x2 1)
#<C1 {772EDF9A}>
CL-USER(4):






More information about the armedbear-devel mailing list