[squeak-dev] Re: Selectors with underscores
yoshiki at vpri.org
Wed Mar 17 18:32:49 UTC 2010
At Fri, 12 Mar 2010 20:01:41 +0100,
Stéphane Rollandin wrote:
> > IMHO, both := and _ are wrong choices. To be consistent with selector
> > conventions, it should have been =: ( for assign:). But I guess it is too late
> > now.
> ah, but _ is not a selector
> now if a newly created identifier symbol was automatically bound to a
> specific instance of ProtoObject, instead of nil which is the sole
> instance of UndefinedObject, then =: could be implemented in ProtoObject
> as syntactic sugar for becomeForward:
> or am I wrong here ?
Hehe. But if a variable (say an instance variable "x" of an object
"obj") already has a non-nil value, what does that mean?
In Smalltalk 72, the left arrow was a message to an atom, in deed.
The index finger hand literal object can be sent a string to get an
atom object and it in turn can receive an left arrow message with an
argument. You can assign atom into another variable. You can define
the left arrow message for a collection to mean "add" instead assign.
For an instance variable, you can use "'s" message followed by a
string also to get the corresponding atom in the reciver context.
More information about the Squeak-dev