Eliminating assignments and variable syntax (accessors)
Marcel Weiher
marcel at system.de
Mon Aug 2 21:36:15 UTC 1999
> From: Travis Griggs <tgriggs at keyww.com>
> There is always a reciever followed by a message send. I'm always
> amused when I read code from Java or C++ where most of the message
sends are of
> the implicit style (ala good ol' functions) and authors obvious
understanding
> of
> the object/messaging pardigm is abviously nil. I'm not averted to
getting rid
> of/or changing assignment syntax, but please don't do the implicit
(or hidden)
> message sending thing.
I think there is some misunderstanding here. The visible change for
(reading) accessors/var-access would be exactly nil, nada, zip,
zilch, nothing. To illustrate, before:
myInstanceVar doSomething.
after:
myInstanceVar doSomething.
The difference is that right now, this expression is always treated
as directly accessing the variable, while with the proposal, it would
be treated as calling the accessor (which is optimized away again
if, for example, there is no accessor). So the *visible* change is
really very, very minimal.
The only visible change is variable writing / mutators, which change from:
myInstanceVar := newValue
to
myInstanceVar: newValue.
That really doesn't seem like such a big deal to me. ( if you
missed it, the '=' disappeard). Again, the importan point is that
the semantics have changed.
Marcel
More information about the Squeak-dev
mailing list
|