assignment message (Re: [squeak-dev] Re: Selectors with underscores)
Yoshiki Ohshima
yoshiki at vpri.org
Wed Mar 17 23:08:55 UTC 2010
At Wed, 17 Mar 2010 22:35:31 +0100,
Stéphane Rollandin wrote:
>
> 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)
Oh, I interpreted what you said as something like:
| a b | "create new variables. (identifier symbols?)"
a gets: b. "???"
a gets: 3. "one of such ProtoObject is becoming 3".
a gets: 4. "???"
and didn't know what would happen.
> Is there a reason, historical or technical, why we need to have only a
> unique instance of UndefinedObject ?
Like using the value 0 to mean nil and false, it is possible. But I
don't see it helps anything...
-- Yoshiki
More information about the Squeak-dev
mailing list
|