[Openmcl-devel] Custom Meta Classes

Gary Byers gb at clozure.com
Mon Jan 19 14:20:56 UTC 2004



On Mon, 19 Jan 2004, Sven Van Caekenberghe wrote:

> We still have problems with this issue, specifically the following file
> can be compiled but cannot be loaded into 0.14-031220:
>
> (defpackage :foo (:use :cl))
>
> (in-package :foo)
>
> (defclass my-meta-class (standard-class)
>    ((extra)))
>
> (defmethod validate-superclass ((class my-meta-class) (super
> standard-class))
>    t)
>
> (defclass foo ()
>    ((bar))
>    (:metaclass my-meta-class))
>
> When I define the same code in cl-user it works...
>
> Sven
>

The generic function #'VALIDATE-SUPERCLASS isn't part of ANSI CL.

It -is- part of the MOP.

The symbol VALIDATE-SUPERCLASS isn't accessible in the CL package.

It -is- exported from both the "CCL" and "OPENMCL-MOP" packages in
OpenMCL.

In the code fragment above, you're (inadvertently) defining a method
on #'FOO::VALIDATE-SUPERCLASSES.  You could either:

a) define the package to use OPENMCL-MOP as well as CL
b) qualify the symbol:

(defmethod openmcl-mop:validate-superclass ...)





More information about the Openmcl-devel mailing list