[squeak-dev] Regression | Cannot interrupt "[  repeat ] fork" anymore
tim at rowledge.org
Fri Dec 17 00:48:11 UTC 2021
> 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
b) vmParameterAt: index ifAbsent: calamityBlock
^(self vmParameterAt: index) ifNil: calamityBlock
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Strange OpCodes: D: Detonate
More information about the Squeak-dev