[Openmcl-devel] Code that causes problems in OpenMCL, not other Lisps

Ralph Richard Cook ralphc at bellsouth.net
Sat Feb 26 19:33:09 PST 2005


I don't know the proper incantations in the CLHS to know exactly where 
this is a problem, in OpenMCL or other Lisps. This small code doesn't 
have a problem in Clisp on windows, SBCL on Linux, SBCL or LispWorks on 
Mac.

I put the following code in testslot.lisp:

(defclass testslot () ((myslot :accessor myslot :initform nil)))

(defclass tester () ((myts :accessor myts :type testslot :initarg :myts 
:initform nil)))

(defmethod initialize-instance :after ((tester tester) &rest initargs)
     (declare (ignore initargs))
     (unless (myts tester) (setf (myts tester) (make-instance 
'testslot))))

(setf mytester (make-instance 'tester))

On openmcl I get:

Welcome to OpenMCL Version (Beta: Darwin) 0.14.2-p1!
? (load "testslot.lisp")
 > Error in process listener(1): The value NIL, derived from the 
initform NIL, can not be used to set the value of the slot MYTS in 
#<TESTER #x637674E>, because it is not of type TESTSLOT.
 > While executing: CCL::%SHARED-INITIALIZE
 > Type :POP to abort.
Type :? for other options.
1 >

Should this work?
Thanks,
Richard Cook




More information about the Openmcl-devel mailing list