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

Re: RFC 0004 - defer {} syntax

Thread Previous | Thread Next
From:
Eirik Berg Hanssen
Date:
June 21, 2021 02:17
Subject:
Re: RFC 0004 - defer {} syntax
Message ID:
CAHAeAG5oi8qd3+013Hh4K5dsgGAjMQONM43ZRNTg+y4iXa+4LA@mail.gmail.com
On Mon, Jun 21, 2021 at 3:37 AM Ben Bullock <benkasminbullock@gmail.com>
wrote:

> I went back and checked, and I've actually said this in all of the
> messages I've sent on this thread, and so far nobody has pointed out the
> mistake in my understanding. Is there some way of sneaking out of if{}
> without arriving at the end of the code?
>

  Yes?  Plenty of ways: An exception may sneak out (all the way to the
first dynamically enclosing eval or similar); a return may sneak out (all
the way out of the subroutine call); a next/last/redo may sneak out (all
the way out of the first dynamically enclosing loop with matching label, if
given); a goto LABEL may sneak out to some arbitrary LABEL.

  And those evals, subroutine calls, and loops may nest in any order.
There's no one obvious outer context, like there's an obvious enclosing
block.


Eirik

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