[squeak-dev] Re: Selectors with underscores
nicolas.cellier.aka.nice at gmail.com
Wed Mar 17 21:41:03 UTC 2010
2010/3/17 Stéphane Rollandin <lecteur at zogotounga.net>:
> 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
>>> 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 ?
Is there a reason why we would need two?
For the VM, it's comfortable to have a well none sole instance of
More information about the Squeak-dev