Article View: comp.lang.clos
Article #71Re: Attempting to circumvent Symbolics' Reader Method optimization
From: Gregor Kiczales
Date: Wed, 08 Apr 1992 17:58
Date: Wed, 08 Apr 1992 17:58
42 lines
2630 bytes
2630 bytes
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
Technical Details
Message-ID:
<92Apr8.105811pdt.29192@tracer-bullet.parc.xerox.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!parc.xerox.COM!GregorReferences:
<9204072351.AA24766@cambridge.apple.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.clos Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!parc.xerox.COM!Gregor From: Gregor@parc.xerox.COM (Gregor Kiczales) Subject: Re: Attempting to circumvent Symbolics' Reader Method optimization Message-ID: <92Apr8.105811pdt.29192@tracer-bullet.parc.xerox.com> Sender: daemon@cis.ohio-state.edu Organization: The Ohio State University Department of Computer and Information Science References: <9204072351.AA24766@cambridge.apple.com> Date: Wed, 8 Apr 1992 17:58:01 GMT Lines: 42