[Openmcl-devel] Bug or spec change?

Paul Krueger plkrueger at comcast.net
Thu Mar 4 14:07:18 PST 2021

I was trying to do a little MOP hacking and when what I was trying to do got errors I went back to “The Art of the Metaobject Protocol” and ran an example from there to see if it encountered similar errors, which it did (most of this from p. 72 of the book):

I’m running Clozure Common Lisp Version 1.11.6 (v1.11.6) DarwinX8664

? (defclass rectangle ()
   ((height :initform 0.0 :initarg :height)
    (width :initform 0.0 :initarg :width)))
? (defclass counted-class (standard-class)
   ((counter :initform 0)))
? (setf (find-class 'counted-rectangle)
       (make-instance 'counted-class
         :name 'counted-rectangle
         :direct-superclasses (list (find-class 'rectangle))
         :direct-slots ()))
> Error: The class #<STANDARD-CLASS RECTANGLE> was specified as a
>       super-class of the class #<COUNTED-CLASS COUNTED-RECTANGLE>;
>       but the meta-classes #<STANDARD-CLASS STANDARD-CLASS> and
>       #<STANDARD-CLASS COUNTED-CLASS> are incompatible.
> Type cmd-. to abort, cmd-\ for a list of available restarts.
> Type :? for other options.
1 > 

My question is whether this is a problem with CCL’s implementation or a spec change of some sort that invalidates the example from the book. It’s not clear to me how you could ever employ meta-classes without getting this sort of error in CCL, so if this isn’t a bug, what’s the work-around?

Thanks ...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20210304/cf35d051/attachment.htm>

More information about the Openmcl-devel mailing list