Article View: comp.lang.clos
Article #66Re: Attempting to circumvent Symbolics' Reader Method optimization
From: Kim Barrett
Date: Wed, 08 Apr 1992 00:56
Date: Wed, 08 Apr 1992 00:56
30 lines
2280 bytes
2280 bytes
> Date: Tue, 7 Apr 1992 10:38-0500 > From: basham@aio.jsc.nasa.gov (Bryan Basham) > > I have written a piece of code that dependends on the reader methods to call > SLOT-VALUE. However, I have discovered that Symbolics' MOP performs an > optimization (?) that does not call SLOT-VALUE. I would like to circumvent > the "empty" creation of Reader Methods and place a real method (that calls > SLOT-VALUE in its place). 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. 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. [Note: While I have a fair amount of experience with implementing CLOS, I have no familiarity whatsoever with Symbolics' implementation. The following suggestion should be considered with that caveat in mind.] The way to circumvent this is to cause your metaclass to not use STANDARD-READER-METHOD for these methods, but to instead use some other method class that does the appropriate thing for your metaclass. You might also be able to hook into the same protocol as used with STANDARD-READER-METHOD in order to implement any optimizations appropriate to your class of accessor methods. Not being a Symbolics wizard, I don't know what generic functions you might need to specialize in order to get this effect. I would probably start by looking for a function called something like add-reader-method.
Technical Details
Message-ID:
<9204072351.AA24766@cambridge.apple.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cambridge.apple.com!kabShow Full Headers
Complete Article Headers
Newsgroups: comp.lang.clos Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!cambridge.apple.com!kab From: kab@cambridge.apple.com (Kim Barrett) Subject: Re: Attempting to circumvent Symbolics' Reader Method optimization Message-ID: <9204072351.AA24766@cambridge.apple.com> Sender: daemon@cis.ohio-state.edu Organization: The Ohio State University Department of Computer and Information Science Date: Wed, 8 Apr 1992 00:56:40 GMT Lines: 31