Auto Generation of Getters/Setters

Todd Nathan todd.nospamski. at palomablanca.net
Thu Nov 18 00:43:42 UTC 1999


> From: Tim Olson <tim at jumpnet.com>
> Date: 1999-11-17 17:43:46 -0700
> To: "Squeak" <squeak at cs.uiuc.edu>
> Subject: RE: Auto Generation of Getters/Setters
>
> >Thanks for the replies,
> >
> >OK I've done that (actually via the menus) and nothing appears to be 
> >happening.
> >What I would expect is that each time I compile a class  
definition I get for
> >each
> >instance variable xyz (say) i get created automatically two methods: 
> >
> >xyz
> >
> >	^xyz
> >
> >xyz: anObject
> >
> >	xyz := anObject
> >
> >What am I missing?
>
>
> The Squeak implementation of auto-accessors is independent of the  
> compiler; it works by intercepting the "doesNotUnderstand:"  
message and
> determining whether the message could be satisfied by a simple  
accessor.
> If so (and if the autoAccessors preference is set), it will  
generate the
> appropriate accessor and continue.
>
> So you simply need to run some code using your new class, and have the  
> accessors dynamically generated.
>
>      -- Tim Olson
>
>

How about doing by adding some code to class creation methods?  Then toss
a selection panel up with the ivars that will be 'auto generated  
for' and then
take those that are selected (also have a do-all button) and and generate
accessors for those...  Make sense?

\t





More information about the Squeak-dev mailing list