[squeak-dev] Regression | Cannot interrupt "[ [] repeat ] fork" anymore

Eliot Miranda eliot.miranda at gmail.com
Fri Dec 17 23:00:36 UTC 2021


> On Dec 16, 2021, at 4:48 PM, tim Rowledge <tim at rowledge.org> wrote:
> 
> 
> 
>> On 2021-12-16, at 4:23 PM, Thiede, Christoph <Christoph.Thiede at student.hpi.uni-potsdam.de> wrote:
>> 
>> Ah. The comment already states it:
>> 
>> "A VM parameter is typically numeric or boolean, and if not implemented will be nil."
>> 
>> So we *do need* to handle nil values here. :-)
> 
> OK, that wasn't very clear to me originally.
> 
>> 
>> Besides, IMHO your proposal (Tim) comes with the drawback of duplicating the primitive. See System-ct.1269. :-)
> 
> Nothing wrong with that. We do it several places.
> 
> Depends what you want. You *could* of course redefine vmParameterAt: to return nil if the prim fails, and I don't see any code in the image that actually handles a prim fail for this, so maybe that would be smart. The prim code looks like it returns nil for any index that is not explicitly handled and only fails if the index exceeds the limit of the params array. So all in all, I'd suggest considering
> a) vmParameterAt: index
> 
>        <primitive: 254>
>        ^nil
> b) vmParameterAt: index ifAbsent: calamityBlock
> 
>    ^(self vmParameterAt: index) ifNil: calamityBlock

+1

> 
> 
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Strange OpCodes: D: Detonate
> 
> 
> 


More information about the Squeak-dev mailing list