Auto Generation of Getters/Setters

Chris Reuter cgreuter at calum.csclub.uwaterloo.ca
Sat Nov 27 04:43:53 UTC 1999


On Fri, Nov 19, 1999 at 02:10:01PM -0800, Stephen Travis Pope wrote:
> 
> This is included in the STP12 goodies. Take a look at the file
> ftp://ftp.create.ucsb.edu/pub/Squeak/goodies/STP12/STP12/System/CodeGen.st.
> This adds the message "publish" that, when sent to a class, compiles
> getter/setter methods for its instance variables.
> 
> stp
> 
> 
> Stewart MacLean wrote:
> 
> > Hi All,
> >
> > Ignoring the issue as to whether this is a good thing or not (I just want to
> > quickly hack something together) is there an auto generation of
> > getters/setters based on the declared instance variables within Squeak or
> > available as a Goodie?


I once slapped together a goodie that adds a "make accessors" menu
item to the browser.  Selecting it generated getters and setters for
the current class for all instance variables that had neither a getter
or a setter.  The only problem (and the reason I never released it) is
that it wouldn't properly update the browser afterward.

If anyone's interested, I can probably dig up a copy.


			  --Chris





More information about the Squeak-dev mailing list