Computer Old Farts Forum
 help / color / mirror / Atom feed
From: Steffen Nurpmeso <steffen@sdaoden.eu>
To: Ralph Corderoy <ralph@inputplus.co.uk>
Cc: coff@tuhs.org
Subject: [COFF] Re: continue N. (Was: I can't drive 55...)
Date: Sat, 11 Mar 2023 18:51:02 +0100	[thread overview]
Message-ID: <20230311175102.Yl3ha%steffen@sdaoden.eu> (raw)
In-Reply-To: <20230311112508.7306220145@orac.inputplus.co.uk>

Ralph Corderoy wrote in
 <20230311112508.7306220145@orac.inputplus.co.uk>:
 |Hi Steffen,
 |
 |COFF'd.
 |
 |> Very often i find myself needing a restart necessity, so "continue
 |> N" would that be.  Then again when "N" is a number instead of
 |> a label this is a (let alone maintainance) mess but for shortest
 |> code paths.
 |
 |Do you mean ‘continue’ which re-tests the condition or more like Perl's
 |‘redo’ which re-starts the loop's body?

No Ralph, i unspecifically meant multiple nested loops where some
inner has to restart/continue the outer (at some point).
So a bit like that of "man perlsyn", but with deeper nesting

       If you need both "next" and "last", you have to do both and also use a
       loop label:

           LOOP: {
               do {{
                   next if $x == $y;
                   last LOOP if $x == $y**2;
                   # do something here
               }} until $x++ > $z;
           }

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

      parent reply	other threads:[~2023-03-11 17:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230309230130.q4I-f%steffen@sdaoden.eu>
     [not found] ` <RHglcvrCs_xHL1NWcH8pkN1l-IQKszfwYFc8sXRTQRRjGa-7kVJWj-OMzOmWkR89xFwEIiWfoLoAAEHkKF8etYwLR3aGRj9VuwO_MhYbz3s=@protonmail.com>
     [not found]   ` <CANCZdfpj_uBkH=hih2Kv+YwTQ-eHOzqgDUJ_+P8a4chOHu=cLQ@mail.gmail.com>
     [not found]     ` <alpine.BSF.2.21.9999.2303101657460.4881@aneurin.horsfall.org>
     [not found]       ` <20230310165552.czZmL%steffen@sdaoden.eu>
2023-03-11 11:25         ` [COFF] " Ralph Corderoy
2023-03-11 15:42           ` [COFF] " Paul Winalski
2023-03-11 17:51           ` Steffen Nurpmeso [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230311175102.Yl3ha%steffen@sdaoden.eu \
    --to=steffen@sdaoden.eu \
    --cc=coff@tuhs.org \
    --cc=ralph@inputplus.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).