[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with :METACLASS option



    Date: Tue, 19 May 87 10:02:22 pdt
    From: Jim Kempf <kempf%hplabsc@hplabs.HP.COM>

    The :METACLASS option to DEFCLASS is causing some circularity
    problems. Supposing I want to have a class at the top of the class
    hierarchy, but the metaclass is not ESSENTIAL-CLASS (or
    STANDARD-CLASS in the CLOS spec). Then, after defining the
    metaclass, I might try to define it as:

    (defclass top-class () () (:metaclass new-metaclass))

    But this gives me a meta/super incompatibility error in 
    CHECK-SUPER-METACLASS-COMPATIBILITY, because class OBJECT is
    included by default, even if the inheritance list is NIL (as in
    this case).

Well, there are at least two ways to fix this.

1. put a method on class-default-includes for your new metaclass that
will cause your class not to include OBJECT when it has no other
includes.  Of course you will probably want to include T, at which point
you will get a similar error, then you can.

2.a put a method on CHECK-SUPER-METACLASS-COMPATIBILITY that says that
OBJECT is an OK super.

2.b put a method on CHECK-SUPER-METACLASS-COMPATIBILITY that says that
CLASS (soon to be standard-class) is an OK super-metaclass.