[squeak-dev] `ensure:` ... doesn't (in some circumstances involving nesting `ensure:` blocks in `ensure:` handlers).

Marcel Taeumel marcel.taeumel at hpi.de
Thu Jul 7 16:09:34 UTC 2022


Hi Tony --

Seems to work now. Except that you will also get MNU #stepToCallee after abandon.

Best,
Marcel
Am 04.11.2021 10:56:48 schrieb Tony Garnock-Jones <tonyg at leastfixedpoint.com>:
Also of note: using `self halt` to debug `ensure:` blocks is made
difficult by this! (Because the process just... disappears!)

On 11/4/21 09:59, Tony Garnock-Jones wrote:
> Here's an example of where `ensure:` doesn't quite do what it says on
> the tin:
>
> [
> [Processor activeProcess terminate] ensure: [
> Transcript cr; show: 'outer1'.
> [nil error: 'aiee'] ensure: [Transcript cr; show: 'inner'].
> Transcript cr; show: 'outer2'.
> ]
> ] fork
>
> Expected output:
>
> outer1
> (debugger appears; click 'abandon')
> inner
>
> (or possibly:
>
> outer1
> (debugger appears; click 'abandon')
> inner
> outer2
>
> which is what you get if you change "Processor activeProcess terminate"
> to "1 + 2" above... but this also seems odd.)
>
> Actual output:
>
> outer1
> (no debugger appears, nothing more happens)
>
> Are my expectations out-of-line, or is there a problem worth
> investigating here?
>
> "--"
>
> I think it's worth noting that a related program:
>
> [
> [Processor activeProcess terminate] ensure: [
> [
> Transcript cr; show: 'outer1'.
> [nil error: 'aiee'] ensure: [
> Transcript cr; show: 'inner'].
> Transcript cr; show: 'outer2'.
> ] on: Error do: [:ex | Transcript cr; show: ex]
> ]
> ] fork
>
> yields the reasonable output
>
> outer1
> Error: aiee
> inner
>
> Cheers,
> Tony
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220707/cead6b39/attachment.html>


More information about the Squeak-dev mailing list