[squeak-dev] The Trunk: Kernel-nice.1384.mcz

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Thu Apr 22 22:52:16 UTC 2021


Hi Jaromir,

Le jeu. 22 avr. 2021 à 23:40, Jaromir Matas <m at jaromir.net> a écrit :
>
> Hi Nicolas, Jacob,
> Apologies if this has nothing to do with your issue (I’m unable to follow
> really) but I can see an inconsistency in the exception ‘return’ behavior:
> There are two types of return – explicit and implicit and I expected them to
> behave identically, however it doesn’t seem to be the case:
>
> [self error] on: Error do: [:ex | ex return ]
> ---> rearms handlerActive
>
> [self error] on: Error do: [:ex | ex ]
> ---> doesn’t rearm handlerActive
>
> The problem (if there’s any) is here:
> handleSignal: exception
>                “…”
>                self tempAt: 3 put: false.  "disable self while executing
> handle block"
>                val := [(self tempAt: 2) cull: exception]
>                                              ifCurtailed: [self tempAt: 3
> put: true].
> --->        self return: val  "return from self if not otherwise directed in
> handle block"
>
> `self return: val` is only executed if the handle block doesn’t contain an
> explicit exception message (retry, return etc) but unlike its explicit `ex
> return` counterpart it has no unwind block...
>
> In any case – is this an issue? Should the two forms of return really behave
> identically as I assumed?
>
> Thanks,
> Jaromir
>
>

Yes.
In the former case we fire the ifCurtailed: block.
in the latter, we do not.

However, that does not make a difference, after we return, the handler
is not anymore on the stack.
What I wonder is whether the ifCurtailed: block is required at all.
I think that it is not.
In my first attempt, some reactivateHandlers were missing, and some
tests would fail without the rearm in ifCurtailed:.
Now, all tests pass without.

>
>
> -----
> ^[^ Jaromir
> --
> Sent from: http://forum.world.st/Squeak-Dev-f45488.html
>


More information about the Squeak-dev mailing list