develooper Front page | perl.perl5.porters | Postings from July 2021

Re: RFC 0004 - defer {} syntax

Thread Previous | Thread Next
Dan Book
July 2, 2021 18:16
Re: RFC 0004 - defer {} syntax
Message ID:
On Fri, Jul 2, 2021 at 12:58 PM David Nicol <> wrote:

> the multiple exceptions behavior looks like a bug to be repaired, not a
> feature to be accommodated.
> IMO The first exception thrown from deferred code should prevent later
> defer blocks in that scope from happening, just as if they were later in
> the code text, instead of getting rearranged there through defer sugar.
> sub foo { say "Hi"; die "two"; die "one" }  # should this not be
> equivalent?

No; the defer blocks were reached, so their scope cleanup should occur
whenever the scope is left, in this case because of an exception


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About