Eliminating assignments and variable syntax (accessors)

Marcel Weiher marcel at system.de
Sat Aug 14 09:50:12 UTC 1999


> From: Daniel Allan Joyce <daniel.a.joyce at worldnet.att.net>

> About the whole assignment speil, I think whats needed is way of
> specifying 'self' without typing it, like a special character, or  
way of
> denoting a function. That would be short, and sweet.
>
> 	Is the apostrophe used?
> 	so, instead of "self foo"
> 	we can say "`foo", or some other perhaps more noticeable  
symbol...

The idea was to reassign variable syntax to mean 'send to self'.   
Both to encourage messaging and discourage (very strongly) direct  
access.

> And simple accessors? Always include them, even if they don't do
> anything but return or access inst vars. A good SmallTalk compiler will 
> always inline anyways, and thuse no need to worry about the extra
> message sends. You may need to change them in the future anyways. By 
> including them from the start, you won't have to go through an object, 
> and change every occurence of 'a :=' to 'self a:'.  It's bitten me on 
> the rear a few times.

Again, that was pretty exactly the idea, except that I wanted to  
also retain some more of the things people found good about direct  
access.  The primary concern I had was with having to change related  
source code when a decision about accessing changes.

> And if its too hard to type 4 extra chars for 'self', well, there is a 
> point were efficency becomes laziness. I mean, CS people are lazy, but 
> THAT lazy?

Didn't you just look for a shorthand a couple of lines earler? :-)

Marcel





More information about the Squeak-dev mailing list