🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.clos
Article #113

Re: Accessors specified in a defclass don't seem to use slot-value in Lucid

#113
From: Gregor Kiczales
Date: Thu, 13 Aug 1992 17:26
43 lines
2851 bytes
(Again, the question had to do with whether automatically generated
accessor methods should call slot-value-using-class and (setf
slot-value-using-class).  That is the intention of the MOP spec, (as if
a document could have intentions) but it doesn't say it anywhere
explictly.)

In article <9208122211.AA15742@quaestor> jmg@inference.COM (Jeff Greif) writes:

   The user can override the automatically-generated accessor methods, or
   supply :around, :before or :after qualifiers to the accessor methods to carry
   out the desired side-effect, without going through SLOT-VALUE-USING-CLASS.
   This would solve Mr. Lovette's problem, but then somebody could call 
   slot-value-using-class instead of the accessor method.
   The real issue is that if there are two paths to change a slot value
   you have to modify both.

What you are proposing, will surely work in some sense.  It corresponds
to changing the program, and you can always do anything you want that
way.  But suppose that Mr. Lovette has a large number of classes, each
with a large number of accessor methods, that he wants to have behave
differently?  Then, your approach becomes cumbersome.

In cases like this, what the MOP allows the user to do is "change the
language itself," in this case so that slot access has some different
behavior, so that the {\em unaltered} program now has a different
behavior.  This ability, properly used, makes it possible to express the
behavior Mr.  Lovett (and others) are after more concisely and elegantly
than under traditional approach of modifying, perhaps in a textually
distributed fashion, the original program.

The point of the MOP, and metaobject protocols in general, is that they
provide a {\em different} cut on affecting the behavior of your program
-- specifically, the difference between changing the program vs.
changing the language it is written in.

With regard to the performance implications of doing it this way, Trent
Lange has already pointed out that the newest PCL does this efficiently.
It's too bad that earlier versions of PCL (one which some commercial
implementations are based) had the bug where they didn't implement this
aspect of the MOP properly.

Gregor
Technical Details
Message-ID: <GREGOR.92Aug13102610@tracer-bullet.parc.xerox.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!darwin.sura.net!zaphod.mps.ohio-state.edu!uwm.edu!bionet!parc!gregor
References: <GREGOR.92Aug12133220@tracer-bullet.parc.xerox.com> <9208122211.AA15742@quaestor>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!gatech!darwin.sura.net!zaphod.mps.ohio-state.edu!uwm.edu!bionet!parc!gregor
From: gregor@parc.xerox.com (Gregor Kiczales)
Newsgroups: comp.lang.clos
Subject: Re: Accessors specified in a defclass don't seem to use slot-value in Lucid
Message-ID: <GREGOR.92Aug13102610@tracer-bullet.parc.xerox.com>
Date: 13 Aug 92 17:26:10 GMT
References: <GREGOR.92Aug12133220@tracer-bullet.parc.xerox.com>
 <9208122211.AA15742@quaestor>
Sender: news@parc.xerox.com
Organization: Xerox Palo Alto Research Center
Lines: 43
In-Reply-To: jmg@inference.COM's message of 12 Aug 92 22:11:45 GMT