Auto Generation of Getters/Setters
Tim Olson
tim at jumpnet.com
Thu Nov 18 00:38:02 UTC 1999
>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
More information about the Squeak-dev
mailing list
|