220 3601 <CAOfiQqkj3LEQD3dViCyWk57T8-VpUArvM13-duMbmb6GCL7ovA@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Richard Smith <richard@metafoo.co.uk>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: "break break ;" etc. to break out of nested loops
Date: Sat, 6 Apr 2013 12:32:05 -0700
Lines: 180
Approved: news@gmane.org
Message-ID: <CAOfiQqkj3LEQD3dViCyWk57T8-VpUArvM13-duMbmb6GCL7ovA@mail.gmail.com>
References: <1f964e4b-2762-43b8-85e5-41392926b07a@isocpp.org>
	<CAOHCbiuv0zLyEu-7RJR9rLzs-zwQRrxbkYjfO3jHTJj2GrGgYQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=14dae93410f938d51b04d9b642dd
X-Trace: ger.gmane.org 1365276726 9191 80.91.229.3 (6 Apr 2013 19:32:06 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 6 Apr 2013 19:32:06 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDVNBJG4YAIBBNXQQGFQKGQEVRZMZ2I@isocpp.org Sat Apr 06 21:32:09 2013
Return-path: <std-proposals+bncBDVNBJG4YAIBBNXQQGFQKGQEVRZMZ2I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ie0-f200.google.com ([209.85.223.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDVNBJG4YAIBBNXQQGFQKGQEVRZMZ2I@isocpp.org>)
	id 1UOYqO-0005ho-2p
	for gclcip-std-proposals@m.gmane.org; Sat, 06 Apr 2013 21:32:08 +0200
Original-Received: by mail-ie0-f200.google.com with SMTP id c11sf26493361ieb.7
        for <gclcip-std-proposals@m.gmane.org>; Sat, 06 Apr 2013 12:32:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-received:x-beenthere:x-received:received-spf:mime-version
         :x-received:sender:in-reply-to:references:date:message-id:subject
         :from:to:x-original-sender:x-original-authentication-results
         :reply-to:precedence:mailing-list:list-id:x-google-group-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=yugchVN3uY/k29Zu1DRd3uHMFDezpTP0QgLDSzCcEmM=;
        b=rqNs1ezYdkEPKzhdNRPwgtvJArwpudC5xi06GibDEkhjBTDVwtgyaiKymZVpNeBLuP
         O9Bt36fNa02wvxq2QkldTrsK1pNdA++EKhzQkXk8CTZYrO4mMtCZZwjHpUIcCDaRXj3K
         URvYMim2V5sv6GBHY9Qlzoxcq3rOumh/67OQfLJgXPP3T5R8qZ6OR69OC0TIaMH0hht0
         5TywRDz1cwOR5cx3cPs12HxCuKCfe6i+PY9sw3yIbUPBqMlGMziY9cFGFaCQmUIev4Mt
         fgXOnNKrEcZn0s1KV6LEy/98umwUOfg8wa0Hpzf/fUNBg/3OUhbsK 
X-Received: by 10.50.82.74 with SMTP id g10mr3637215igy.7.1365276727106;
        Sat, 06 Apr 2013 12:32:07 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.135.35 with SMTP id pp3ls1284969igb.1.canary; Sat, 06 Apr
 2013 12:32:05 -0700 (PDT)
X-Received: by 10.43.134.202 with SMTP id id10mr8225893icc.46.1365276725539;
        Sat, 06 Apr 2013 12:32:05 -0700 (PDT)
Original-Received: from mail-ia0-x22a.google.com (mail-ia0-x22a.google.com [2607:f8b0:4001:c02::22a])
        by mx.google.com with ESMTPS id x14si8491426igg.53.2013.04.06.12.32.05
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sat, 06 Apr 2013 12:32:05 -0700 (PDT)
Received-SPF: pass (google.com: domain of metafoo@gmail.com designates 2607:f8b0:4001:c02::22a as permitted sender) client-ip=2607:f8b0:4001:c02::22a;
Original-Received: by mail-ia0-f170.google.com with SMTP id h8so4169037iaa.29
        for <std-proposals@isocpp.org>; Sat, 06 Apr 2013 12:32:05 -0700 (PDT)
X-Received: by 10.50.212.74 with SMTP id ni10mr2776501igc.60.1365276725136;
 Sat, 06 Apr 2013 12:32:05 -0700 (PDT)
Original-Sender: metafoo@gmail.com
Original-Received: by 10.64.168.99 with HTTP; Sat, 6 Apr 2013 12:32:05 -0700 (PDT)
Original-Received: by 10.64.168.99 with HTTP; Sat, 6 Apr 2013 12:32:05 -0700 (PDT)
In-Reply-To: <CAOHCbiuv0zLyEu-7RJR9rLzs-zwQRrxbkYjfO3jHTJj2GrGgYQ@mail.gmail.com>
X-Original-Sender: richard@metafoo.co.uk
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of metafoo@gmail.com designates 2607:f8b0:4001:c02::22a as permitted
 sender) smtp.mail=metafoo@gmail.com;       dkim=pass header.i=@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post?hl=en>,
 <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?hl=en&topic=25838>,
 <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:3601
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/3601>

--14dae93410f938d51b04d9b642dd
Content-Type: text/plain; charset=ISO-8859-1

On Apr 5, 2013 3:23 PM, "Tony V E" <tvaneerd@gmail.com> wrote:
>
>
>
>
> On Fri, Apr 5, 2013 at 3:23 PM, <temptony@freemail.hu> wrote:
>>
>> I suggest the following syntax:
>>
>> The break break statement jumps out of the second-nearest enclosing do,
for, switch, or while statement.
>> The break break break statement jumps out of the third-nearest
enclosing do, for, switch, or while statement.
>> The break break break break statement jumps out of the fourth-nearest
enclosing do, for, switch, or while statement.
>>
>
> break;
> break(2);
> break(3);
> break(4);
>
> (and break(1) would also work).
>
> Not sure about runtime values
>
> int n = ...
> break(n);
>
> And I'd rather have:
>
> break name;
>
> For a named loop construct somehow. Maybe
>
> label: for (;;)
> {
>    break label;
> }
>
>
> And all that is not saying I agree with any of it, or really want it;
just some suggestions.

I think I would prefer

for outer (...) {
  for (...) {
    if (...)
      break outer;
  }
}

Using a label to refer to its labeled statement feels like an abuse of the
facility to me.

> Tony
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
"ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.



--14dae93410f938d51b04d9b642dd
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<p dir=3D"ltr"><br>
On Apr 5, 2013 3:23 PM, &quot;Tony V E&quot; &lt;<a href=3D"mailto:tvaneerd=
@gmail.com">tvaneerd@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Fri, Apr 5, 2013 at 3:23 PM, &lt;<a href=3D"mailto:temptony@freemai=
l.hu">temptony@freemail.hu</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; I suggest the following syntax:<br>
&gt;&gt;<br>
&gt;&gt; The=A0break=A0break statement jumps out of the second-nearest encl=
osing=A0do, for, switch,=A0or=A0while=A0statement.<br>
&gt;&gt; The=A0break=A0break=A0break=A0statement jumps out of the third-nea=
rest enclosing=A0do, for, switch,=A0or=A0while=A0statement.<br>
&gt;&gt; The=A0break=A0break=A0break break=A0statement jumps out of the fou=
rth-nearest enclosing=A0do, for, switch,=A0or=A0while=A0statement.<br>
&gt;&gt;<br>
&gt;<br>
&gt; break;<br>
&gt; break(2);<br>
&gt; break(3);<br>
&gt; break(4);<br>
&gt; =A0<br>
&gt; (and break(1) would also work).<br>
&gt;<br>
&gt; Not sure about runtime values<br>
&gt;<br>
&gt; int n =3D ...<br>
&gt; break(n);<br>
&gt;<br>
&gt; And I&#39;d rather have:<br>
&gt;<br>
&gt; break name;<br>
&gt;<br>
&gt; For a named loop construct somehow. Maybe<br>
&gt;<br>
&gt; label: for (;;)<br>
&gt; {<br>
&gt; =A0=A0 break label;<br>
&gt; }<br>
&gt;<br>
&gt;<br>
&gt; And all that is not saying I agree with any of it, or really want it; =
just some suggestions.</p>
<p dir=3D"ltr">I think I would prefer </p>
<p dir=3D"ltr">for outer (...) {<br>
=A0 for (...) {<br>
=A0=A0=A0 if (...)<br>
=A0=A0=A0=A0=A0 break outer;<br>
=A0 }<br>
}</p>
<p dir=3D"ltr">Using a label to refer to its labeled statement feels like a=
n abuse of the facility to me.</p>
<p dir=3D"ltr">&gt; Tony<br>
&gt;<br>
&gt; -- <br>
&gt; =A0<br>
&gt; --- <br>
&gt; You received this message because you are subscribed to the Google Gro=
ups &quot;ISO C++ Standard - Future Proposals&quot; group.<br>
&gt; To unsubscribe from this group and stop receiving emails from it, send=
 an email to <a href=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org">std-=
proposals+unsubscribe@isocpp.org</a>.<br>
&gt; To post to this group, send email to <a href=3D"mailto:std-proposals@i=
socpp.org">std-proposals@isocpp.org</a>.<br>
&gt; Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/g=
roup/std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/st=
d-proposals/?hl=3Den</a>.<br>
&gt; =A0<br>
&gt; =A0<br>
</p>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

--14dae93410f938d51b04d9b642dd--

.
