becomeForward makes corrupted objects

stéphane ducasse ducasse at iam.unibe.ch
Mon Nov 22 13:16:07 UTC 2004


On 22 nov. 04, at 11:31, Martin Kuball wrote:

> Am Sunday 21 November 2004 19:41 schrieb stéphane ducasse:
>> martin I did not check carefully so I may totally wrong but in VW
>> x become: nil was a documented mistake

Because in VW after xxx become: nil all the xxx would refer to nil
and in that case will not be garbaged anymore and all the variables 
pointing to nil
will then point to xxx.

> I do not know VW. And I can't remember where I read about this
> becomeForward trick to get rid of unwanted stuff. But I agree that it
> is actually the wrong way to deal with the problem of unwanted
> references.
>
>> x become: String new was suggested. else everything was pointing to
>> nil
>>
>> :)
>>
>> Now the becomeForward: of squeak has different sematnics than the
>> become of visualworks and
>> is equivalent to oneWayBecome:
>>

VW become is symetric this is a real atomic swap of reference.
VWOneway is similar to becomeForward:  because only the the arg 
reference.

Stef




More information about the Squeak-dev mailing list