MOP Multiple Metaclass Inheritance?
Hi all,Been doing some persistent object stuff here, and MOP works like a champ. But I have run into a situation where some objects contain persistent slots AND some slots that are "virtual" in the sense that their reader returns values computed on the basis of the values contained in other slots, some of which are persistent.
So I defined a PERSISTENT-METACLASS to handle objects containing persistent slots, and a COMPUTABLE-METACLASS to handle objects containing computable slots. Both work great.
But now, in order to produce objects that contain both kinds of slots, I had to stack the metaclasses so that COMPUTABLE-METACLASS inherits from STANDARD-CLASS, and then have PERSISTENT-METACLASS inherit from COMPUTABLE-METACLASS -- even though there is really nothing about the two metaclasses that should warrant an inheritance relationship between them.
;; --------------------------------------------------------------
;; metaclass of objects that might contain computed slots
(defclass computed-metaclass (#+:LISPWORKS clos:standard-class
#+:ALLEGRO clos::standard-class)
())
;; --------------------------------------------------------------
;; metaclass of objects that might contain persistent slots
(defclass persistent-metaclass (computed-metaclass) ;; ??
())
;; --------------------------------------------------------------
We can do multiple inheritance at the CLOS level. But what about at the MOP Meta-level where we have to declare our new class definition's :metaclass ??
Dr. David McClain
Chief Technical Officer
Refined Audiometrics Laboratory
4391 N. Camino Ferreo
Tucson, AZ 85750
email: dbm@refined-audiometrics.com
phone: 1.520.390.3995