assignment message (Re: [squeak-dev] Re: Selectors with
underscores)
Igor Stasenko
siguctua at gmail.com
Thu Mar 18 08:53:35 UTC 2010
2010/3/18 Stéphane Rollandin <lecteur at zogotounga.net>:
>> it won't go that way, because #becomeForward: replacing all references
>> to same object:
>>
>> a := z.
>> b := z.
>> (here a and b pointing to same object - z)
>>
>> b := x.
>>
>> now, 'a' should still point to 'z', while 'b' should point to 'x'.
>> but if you do z becomeForward: x , then both a and b will point to x.
>
> right. that's what I missed :)
>
But, if you add an indirection, that every object slots is a unique objects,
then you can make an assignment as a message , implemented
primitively, which replacing its contents, i.e.
if 'a' is an instance variable of 'object', then
a := b. => object slotA setValue: b.
a => object slotA value
> Stef
>
--
Best regards,
Igor Stasenko AKA sig.
More information about the Squeak-dev
mailing list
|