[squeak-dev] [BUG][FIX] Bug in WeakMessageSend

Juan Vuletich juan at jvuletich.org
Wed May 13 14:01:24 UTC 2009


Done. Mantis issue 7352. Please take a look at updated code.

Comments interleaved...

Nicolas Cellier wrote:
> Oh, and I forgot, correct class comment:
>
>  shouldBeNil		Array of: Boolean --  used to distinguish nil arguments
> from garbage collected arguments
>
>   
added

> 2009/5/12 Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>:
>   
>> Oops I did not understand the API at first glance...
>> 3) was wrong because arguments are added first, and anArray last -
>>
>> One more thing: WeakActionSequence using isValid test is fragile too...
>>
>>     

It actually was not fragile, becuse it used the new safe methods in 
WeakMessageSend. What I did is to remove the #isValid tests.

>> 2009/5/12 Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>:
>>     
>>> Yes sure, that was stupid!
>>>
>>> But:
>>>
>>> 1) #value & al used to return the value of evaluating the message, or
>>> nil if any receiver/argument garbaged.
>>> Now #value & al will always return self
>>>       

fixed. thanks.

>>> 2) #valueWithArguments: should not care if arguments were garbage
>>> collected, because some replacement arguments were provided
>>>       

What I did with this is to honor the old behavior. The (unwritten) 
specification is: "If the receiver or some argument is collected, then 
do nothing". Sounds reasonable, and I saw no reason to change this.

>>> 3) #valueWithEnoughArguments: should care of garbage collected
>>> arguments from: anArray size to: arguments size.
>>>
>>> Please publish a mantis report, then upload your updated code :)
>>>
>>> Cheers
>>>
>>>       

I also changed all _ to := , to ease integration in Croquet.

Cheers,
Juan Vuletich



More information about the Squeak-dev mailing list