[squeak-dev] The Inbox: Kernel-jar.1399.mcz

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Sun May 2 19:55:59 UTC 2021

Le dim. 2 mai 2021 à 15:12, <commits at source.squeak.org> a écrit :
> A new version of Kernel was added to project The Inbox:
> http://source.squeak.org/inbox/Kernel-jar.1399.mcz
> ==================== Summary ====================
> Name: Kernel-jar.1399
> Author: jar
> Time: 2 May 2021, 3:12:37.830089 pm
> UUID: d288b516-c6f1-ce43-9061-2220422b8ab4
> Ancestors: Kernel-jar.1398
> Fix inconsistent implementation of an explicit and an implicit exception return.
> I'd like to return to my original proposal in http://forum.world.st/The-Inbox-Kernel-nice-1391-mcz-tp5129040p5129084.html. The problem then was a bug in #outer that confused me. The bug has been fixed and the original proposal in my opinion makes sense again - to unify how the two kinds of exception return are implemented. Theoretically it's possible to change the #return definition in the future and then the two returns would diverge.

Maybe it has a virtue of making the return more explicit.
Currently, behavior differs only if someone refines OwnException>>return:
    OwnException>>return: anObject
        self logReturn: anObject.
        ^super return: anObject
I wonder what would be the expectations of someone using implicit return:
     howMany := [self countTheThings] on: OwnException do: [:exc | -1
"error condition"]
Shall above construction logReturn: or not?
Currently it doesn't.
You are proposing that it does...
I have no strong opinion.

> =============== Diff against Kernel-jar.1398 ===============
> Item was changed:
>   ----- Method: Context>>handleSignal: (in category 'private-exceptions') -----
>   handleSignal: exception
>         "Sent to handler (on:do:) contexts only.
>         Execute the handler action block"
>         | val |
>         <primitive: 199>  "just a marker, fail and execute the following"
>         exception privHandlerContext: self contextTag.
>         self deactivateHandler. "Prevent re-entering the action block, unless it is explicitely rearmed"
>         val := [self fireHandlerActionForSignal: exception] ensure: [self reactivateHandler].
> +       exception return: val  "return from exception handlerContext if not otherwise directed in handle block"!
> -       self return: val  "return from self if not otherwise directed in handle block"!

More information about the Squeak-dev mailing list