I was wondering if anyone could put me straight about the PRAGMATICS
of using metaclasses with CMUCL and PCL.  Here's the deal: I have some
code that I'd like to use with CMUCL.  That code is currently used
happily with Franz' Allegro CL.  The code makes some use of
metaclasses.  Not extensive use, but some.

Consider an example: There's a metaclass we'll call MY-CLASS that has
a couple of features to it, most importantly being that any class that
has that class as its metaclass, will track all of its instances, etc.

So, for example, the metaclass has an instances slot:


(defclass my-class (standard-class)
     (
      (instances :initform nil :accessor instances)
      )
  )

I've read the "Hints for using the PCL MOP" web page, and as far as I
could tell, in order to get from a class object to this instances
slot, I (believed I) had to interject the following method definition:

#+cmu
(defmethod instances ((class standard-class))
  (instances  (kernel:class-pcl-class class)))

That's fine, but I don't see that I can shadow every single method on
my-class with a definition like the above.  Especially since the code
will still be used with Allegro.

Is there a standard workaround for this kind of thing?

Thanks,
R

Reply via email to