[squeak-dev] Re: Selectors with underscores

Stéphane Rollandin lecteur at zogotounga.net
Wed Mar 17 21:35:31 UTC 2010


Le 17/03/2010 19:32, Yoshiki Ohshima a écrit :
> 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?

Well, a variable always has a value, nil or non-nil, so I don't really 
see your point. The thing with the nil value, is that it is shared by 
all other objects having a nil value. If all nils weren't the same nil, 
we could becomeForward: any of them into existence as a defined object 
(in contrast with an UndefinedObject)

Is there a reason, historical or technical, why we need to have only a 
unique instance of UndefinedObject ?

Stef





More information about the Squeak-dev mailing list