[Openmcl-devel] class precedence list
Bill St. Clair
wws at clozure.com
Tue Jun 17 07:37:17 EDT 2008
The error is correct. You have specified that mymix should come before
mysuper in the class precedence list of myclass. But the defclass for
mysuper specifies that mymix is a superclass of mysuper, hence mymix
must come AFTER mysuper in a class precedence list. Contradiction.
Removing mymix from the superclass list of myclass works:
(defclass myclass (mysuper) ())
You could also include mymix after mysuper. In this example, that
isn't necessary, since inheritance does the job, but if you had more
than one mixin class, you might want to specify which one comes first.
(defclass myclass (mysuper mymixin) ())
On Tue, Jun 17, 2008 at 7:00 AM, Arthur W Cater <arthur.cater at ucd.ie> wrote:
> Loading the following:
> ; -----
> (defclass mymix () ())
> (defclass mysuper (mymix) ())
> (defclass myclass (mymix mysuper) ())
> ; -----
> causes an error
>> Error: Inconsistent superclasses for #<STANDARD-CLASS MYCLASS>
>> While executing: CCL::COMPUTE-CPL, in process Listener(5).
> I believe it is legal, but stand to be corrected. It compiles ok.
> (I run Clozure Common Lisp Version 1.2-r9610M-RC1,
> cocoa application image, G4 powerbook, OS 10.4.11)
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
More information about the Openmcl-devel