Is this PEP-able? fwhile

jfharden at gmail.com jfharden at gmail.com
Wed Jun 26 06:00:35 EDT 2013


On Wednesday, 26 June 2013 01:40:22 UTC+1, Dennis Lee Bieber  wrote:

> (hmmm, does any
> language have a continue that can go to the next iteration of an outer
> loop?)

Perl allows next with a label:

> perldoc -f next
   next LABEL
   next    The "next" command is like the "continue" statement in C; it
           starts the next iteration of the loop:

                LINE: while (<STDIN>) {
                   next LINE if /^#/;      # discard comments
                   #...
               }

           Note that if there were a "continue" block on the above, it
           would get executed even on discarded lines.  If the LABEL is
           omitted, the command refers to the innermost enclosing loop.



More information about the Python-list mailing list