From: Manuel Kolp
Subject: Allegro CL 3: problems when combining metaclasses and superclasses
Date: 
Message-ID: <4lspuq$smn@sci3.sri.ucl.ac.be>
Hi World,

I am trying to implement some metaclass mechanisms in allegro CL but
I have some problems when combining metaclasses and superclasses.

Is Allgro CL 3.0 CLOS compatible with the metaobject protocol developed in
the book "The Art of the Metaobject Protocol" (Kiczales, des Rivieres,
Bobrow) and the PCL CLOS implementation exposed in this book?



(defclass rectangle ()
    ((height :initform 0.0 :initarg :height)
     (width :initform 0.0 :initarg :width)))

(defclass counted-class (standard-class)
    ((counter :initform 0)))

(defclass counted-rectangle (rectangle)
    ()
   (:metaclass counted-class))

When I try to load it, the following message is displayed on
the screen :

;; Error: When defining a standard class, the DIRECT-SUPERCLASSES
;; argument contains #<STANDARD-CLASS RECTANGLE #x8673BCF4> which
;; is incompatible with the metaclass #<COUNTED-CLASS #x86744084>.

This example works with no problems with
CLISP + PCL or Closette (the CLOS implementation subset explained in AMOP)

Is there a better way to implement this example in Allegro CL?

Thanks in advance
Sincerely Yours
-------------------------------------------------------
Manuel Kolp                e-mail : ····@qant.ucl.ac.be
University of Louvain
School of Management
Quantitative Methods and Management Information Systems
1, Place des Doyens     B-1348 Louvain-La-Neuve Belgium
Tel. : +32-10.47.83.93            Fax : +32-10-47.83.24
-------------------------------------------------------
From: Andre Mayers
Subject: Re: Allegro CL 3: problems when combining metaclasses and superclasses
Date: 
Message-ID: <318225fa.1263544@132.212.11.74>
you must define a method on validate-superclass ion order to declare
that counted-class and standard-class are compatible. 

(defclass rectangle ()
    ((height :initform 0.0 :initarg :height)
     (width :initform 0.0 :initarg :width)))

(defclass counted-class (standard-class)
    ((counter :initform 0)))
------------ ADD this 
(defmethod validate-superclass ((class counted-class) (super
standard-class))
   t)
---------------      
(defclass counted-rectangle (rectangle)
    ()
   (:metaclass counted-class))


On 27 Apr 1996 09:38:34 GMT, ····@tcp.co.uk (Manuel Kolp) wrote:
>Hi World,
>
>I am trying to implement some metaclass mechanisms in allegro CL but
>I have some problems when combining metaclasses and superclasses.
>
>Is Allgro CL 3.0 CLOS compatible with the metaobject protocol developed in
>the book "The Art of the Metaobject Protocol" (Kiczales, des Rivieres,
>Bobrow) and the PCL CLOS implementation exposed in this book?

The metaobject protocol is not completely implemented in ACL. You
can't extend the generic function class protocol or use funcallable
object class for example. 

Andre
SAFARI