From: Steve Haflich
Subject: Re: Before method for SLOT-VALUE
Date: 
Message-ID: <SMH.94Aug4024456@vapor.Franz.COM>
In article <··········@tribune.usask.ca> ·····@skorpio.usask.ca (Arun Ramanujapuram) writes:

   From: ·····@skorpio.usask.ca (Arun Ramanujapuram)

   I am trying to define a before method to the method slot-value-using-class. I
   tried with the code below, but it did not work on Allegro cl ver 4.2 R1 on Sparc.
   (ie, slot-value never seemed to call slot-value-using-class)

   (defclass slot-daemon-class (standard-class) ())
   (defmethod slot-value-using-class :before
	      ((class standard-class) (object standard-object) slot-name)
     (format t "The slot ~S is being read." slot-name))

   Could you please give me pointers on how exactly to define the 
   `check-super-metaclass-compatibility' or `validate-superclass' methods?   

I don't think your problems have anything to do with
VALIDATE-SUPERCLASS.  I can see two bugs in your method definition:

First, you defined your metaclass slot-daemon-class, but wrote your
method on standard-class.  The AMOP defines "specified" to be those
geneeric functions and classes that are defined as parts of CL and the
MOP (section 5.3.1), and then disallows any conforming user program
from writing a method on a "specified" generic function specialized
only on "specified" classes.  The reason is that this part of the
method namespace (if I can coin a term) belongs to the implementation,
and adding or modifying such a method may break the implementation
(especially how it copes with metacircularity).  Clearly you wanted to
specialize your method on slot-daemon-class.  I suspect Allegro is
just not noticing your method since it doesn't expect any additional
within the "specified" method namespace.

Second, unless you write this method in a package that uses the CLOS
package (which is where the MOP lives in Allegro) you defined a method
on some symbol other than CLOS:SLOT-VALUE-USING-CLASS, such as
USER::SLOT-VALUE-USING-CLASS.

When I fix these two problems your code worked for me.