[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Attempting to circumvent Symbolics' Reader Method optimization



   Date:	Tue, 7 Apr 1992 17:56:40 -0700
   From:	kab@cambridge.apple.com (Kim Barrett)

   I don't believe there is anything in the specification that requires (or even 
   implies) that the methods defined by DEFCLASS actually call SLOT-VALUE, and I 
   believe this is intentional, as it permits some significant optimizations.

Just to clarify which specification you are talking about here, I assume
you mean the AMOP text, and not the draft ANSI standard.  This problem
seems to be far enough into MOP land that the ANSI standard just doesn't
cover it.

I have just looked through the relevant parts of the AMOP, and indeed it
doesn't seem to explicitly require automatically generated methods to
call SLOT-VALUE (and hence SLOT-VALUE-USING-CLASS).  That is a shame,
because it was certainly our intention that it should do so.  This seems
to have fallen in the crack between the CLOS standard and the AMOP.

The idea is that by defining a method on SLOT-VALUE-USING-CLASS you
should be able to affect all accesses to the slots.  If the
automatically generated methods don't call SLOT-VALUE this won't work.
In fact, the only reason I know of for SLOT-VALUE being in the language
is to support this.  Note that other CLOS-like languages without MOPs
don't have SLOT-VALUE and seem to get along without it.


   The 
   whole point of the class STANDARD-READER-METHOD is that it permits the 
   effective method computation to notice that the only applicable method is one 
   whose definition is understood by the implementation, thereby allowing the 
   access to be inlined in the effective method or even "hoisted" up into the 
   generic function dispatcher.

Its still possible to do the significant optimization, you just have to
be a little bit more careful.  You must notice both that the only
applicable method on the reader generic function is one that is
understood by the implementation and then notice further that the only
applicable method on SLOT-VALUE-USING-CLASS is one that is known to the
implementation.  Then you can do the same optimization.

Gregor