develooper Front page | perl.perl5.porters | Postings from January 2022

Re: Pre-RFC: try/catch/finally and generic finally blocks

Thread Previous | Thread Next
From:
David Nicol
Date:
January 19, 2022 19:47
Subject:
Re: Pre-RFC: try/catch/finally and generic finally blocks
Message ID:
CAFwScO-2CXU2fA7r6A3OxpZ83f5RTwChryghsAfQ2sKC=FH1aA@mail.gmail.com
On Wed, Jan 19, 2022 at 5:48 AM Paul "LeoNerd" Evans <leonerd@leonerd.org.uk>
wrote:

>
> next/last/redo all act the same way, so I didn't add three tests for
> each on the hope that the `last` one is sufficient for them all.
>


My expectations of what next/last/redo would do in a finally block are as
follows:


   - last jumps to the end of the finally block
   - redo starts the finally block over (not the exception handler, but you
   should be able to get there with goto label)
   - next jumps to the test for the outer interator, if any, as if it was
   stated outside of the construct. Why is next even an issue in
   try/catch/finally? it isn't an interator.

or does "act the same way" just have to do with scope cleanup, and "the
same way" means "no change to how they act" ?

-- 
"Lay off that whiskey, and let that cocaine be!" -- Johnny Cash

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About