220 27255 <2e118de4-f49a-4c12-b0d3-d881d3660d43@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: gmisocpp@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: loop continuation code
Date: Mon, 25 Jul 2016 14:12:12 -0700 (PDT)
Lines: 156
Approved: news@gmane.org
Message-ID: <2e118de4-f49a-4c12-b0d3-d881d3660d43@isocpp.org>
References: <2f575934-e078-411c-9c8a-c2996da7609d@isocpp.org>
 <28358863-5be0-401a-893a-0ae5385156c2@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1433_102576338.1469481132284"
X-Trace: ger.gmane.org 1469481139 5527 80.91.229.3 (25 Jul 2016 21:12:19 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 25 Jul 2016 21:12:19 +0000 (UTC)
Cc: gmisocpp@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCM3TRNUXUDBBLMB3K6AKGQECGUWJWI@isocpp.org Mon Jul 25 23:12:18 2016
Return-path: <std-proposals+bncBCM3TRNUXUDBBLMB3K6AKGQECGUWJWI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qk0-f199.google.com ([209.85.220.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCM3TRNUXUDBBLMB3K6AKGQECGUWJWI@isocpp.org>)
	id 1bRnAf-00083x-C0
	for gclcip-std-proposals@m.gmane.org; Mon, 25 Jul 2016 23:12:17 +0200
Original-Received: by mail-qk0-f199.google.com with SMTP id a123sf464799450qkd.2
        for <gclcip-std-proposals@m.gmane.org>; Mon, 25 Jul 2016 14:12:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=X0M+z6vUBFhFhnQfw8rQ5r7VmDZ2fKVb4H0DJiJ248k=;
        b=00Td+vib7EmnlhLzXh/LaXGFXA9P2C+Kh4QQVlDY9Ra+XSViOuTAD3lqh6k/pf/L8U
         rWhcJoJlgaAOkpxr/1gtgGNjshp0ytROOCgTuJ2VLE2xT4myvzhJCmL0KcIp1JpMst74
         U60k1yw2neC7bD84R3q+nUhoq3baKD+ySDee+rMycoJPThcqsc8yNBrrUBNjafHZxWTD
         /r+baJH1ZEy/sv7p2XCd9ucjrRnglY985KE4drA4jNfnELxHPCHkxwJnTtOa1TKZ021V
         IRMc3twZQ/h0//QH90aPDKqLFhvaGWk+663avjZcyh5TIdNZSZXQRnNkZLSha2f2bE4d
         G/8A==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=X0M+z6vUBFhFhnQfw8rQ5r7VmDZ2fKVb4H0DJiJ248k=;
        b=o2a9baoIbnkFEOJJp3ZpL9vTtdWH9qmj4Iobr4psHLTqzqJHvqejxFjxj9hD0O6o3L
         eTUUw3e1k8GcBgUkAs/jaw7I3NUrKF2nJkhgT0Yr2NfDEqjK13yMjLYh5XkNgsuwl71B
         8S+OlRXedExleMET+VyGMxF1YQtQyKkOHZJnkS8mzExkcLmhRStRD9XeQ0oBW3wtAGEL
         pMK7zrT92D6ZIKkUk1QiQdaJPn6Elrf0sMTdOoD7TQMgh2PVRCWNeDH0Kbsz7vlhS14f
         68FFlrGjuYw/t4AkLGsLUq6pIxRY7bmpxWspudfuy+PEMLdPbRWuUH7wc452pHCfQKsS
         4WCw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:x-original-sender:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=X0M+z6vUBFhFhnQfw8rQ5r7VmDZ2fKVb4H0DJiJ248k=;
        b=SyQ0tbhRPizfO7NOyIwDZceT0BgmQIwUG92xEL6HdlTcbNquSv3g0cYJpYPhPULL3Y
         I0iHeHq/7L+l9tRVTrTBI8BPmLSIm7g4uaZdfYu1eDmwwZxKKkKCtkrJiO3HyNe3Z1pt
         ZEHhEgkJLrVjRoBpln7CPpufqwLEqZBOPRNiDVFhCxioQgu/qpq2KmYyLJ6SXvREW9uQ
         IVm9X7Ls2yI8hfq9Ye43kGr6BX/31eFbPXBu8gTOvqYH4HJb9pfBW1I9svvJTLbMsaWQ
         kSkgwYAoVHbNSiDDrXq/4fTvkKiGg206oufAtBaaKbwmDQxuauBnNiInfTYQ4Ccu3uYs
         1H7g==
X-Gm-Message-State: AEkoouuuWboL+PXFR6Z0RvzAA8SPHRWXGaCVu0FvwsPx6C5RD6vXT2/cUA7KXPBFaNwz6g==
X-Received: by 10.176.1.116 with SMTP id 107mr17450233uak.8.1469481136375;
        Mon, 25 Jul 2016 14:12:16 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.236.2 with SMTP id g2ls3849570ith.22.gmail; Mon, 25 Jul
 2016 14:12:12 -0700 (PDT)
X-Received: by 10.36.217.2 with SMTP id p2mr642469itg.5.1469481132835;
        Mon, 25 Jul 2016 14:12:12 -0700 (PDT)
In-Reply-To: <28358863-5be0-401a-893a-0ae5385156c2@isocpp.org>
X-Original-Sender: gmisocpp@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:27255
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/27255>

------=_Part_1433_102576338.1469481132284
Content-Type: multipart/alternative; 
	boundary="----=_Part_1434_234713489.1469481132284"

------=_Part_1434_234713489.1469481132284
Content-Type: text/plain; charset=UTF-8

Hi Nicol

Thanks for your comments.

On Tuesday, July 26, 2016 at 3:08:23 AM UTC+12, Nicol Bolas wrote:

> I get the idea, but I really don't like the syntax for it. Especially 
> since it's based on a symptom (ie: how you would write it with goto) rather 
> than the problem.
>

I think you correctly understand the problem statement, but I'm less 
sure from you're wording that you appreciated what I actually proposed and 
that I too understand the problem statement.
See below:


> The actual problem is that there are times when your iteration statement 
> can't be a single expression. So what you want is to have a 
> multi-expression iteration statement. So... do that:
>
> for ( int i = 0; pUnicast != NULL;
>   pUnicast = pUnicast->Next; i++)
>

This puts all of the iteration logic in the same place: the `for` statement 
itself. So if you want to see what happens on each loop, you don't have to 
look at both the top and the bottom of the `for` statement.

Yes that is the problem, but I don't like the existing for loops syntax, so 
I'm not sure it's meaningful to propose that back to me, especially when my 
proposal also catered for the logic being at the top of the loop. See:

for ( int i = 0; pUnicast != NULL; )
{
  continue {
  pUnicast = pUnicast->Next;
  ++I;
  }
// whatever
}


I'm hearing you don't like my proposed syntax. let's find a better one 
then. You are currently holding onto the existing syntax and I don't find 
that superior to my suggestion for anything but the most trivial of 
situations. I'm looking for something that scales better for the non 
trivial situations.


Thanks

-- 
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/2e118de4-f49a-4c12-b0d3-d881d3660d43%40isocpp.org.

------=_Part_1434_234713489.1469481132284
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi Nicol</div><div><br></div><div>Thanks for your com=
ments.<br><br>On Tuesday, July 26, 2016 at 3:08:23 AM UTC+12, Nicol Bolas w=
rote:</div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0=
..8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left=
-width: 1px; border-left-style: solid;"><div dir=3D"ltr"><div>I get the ide=
a, but I really don&#39;t like the syntax for it. Especially since it&#39;s=
 based on a symptom (ie: how you would write it with goto) rather than the =
problem.<br></div></div></blockquote><div><br></div><div>I think you correc=
tly understand the problem statement, but I&#39;m less sure=C2=A0from you&#=
39;re wording that you appreciated=C2=A0what I actually=C2=A0proposed=C2=A0=
and that I too understand the problem statement.</div><div>See below:</div>=
<div><br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0=
px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-=
left-width: 1px; border-left-style: solid;"><div dir=3D"ltr"><div><br>The a=
ctual problem is that there are times when your iteration statement can&#39=
;t be a single expression. So what you want is to have a multi-expression i=
teration statement. So... do that:<br><br><div style=3D"border: 1px solid r=
gb(187, 187, 187); border-image: none; -ms-word-wrap: break-word; backgroun=
d-color: rgb(250, 250, 250);"><code><div><span style=3D"color: rgb(0, 0, 13=
6);">for</span><span style=3D"color: rgb(0, 0, 0);"> </span><span style=3D"=
color: rgb(102, 102, 0);">(</span><span style=3D"color: rgb(0, 0, 0);"> </s=
pan><span style=3D"color: rgb(0, 0, 136);">int</span><span style=3D"color: =
rgb(0, 0, 0);"> i </span><span style=3D"color: rgb(102, 102, 0);">=3D</span=
><span style=3D"color: rgb(0, 0, 0);"> </span><span style=3D"color: rgb(0, =
102, 102);">0</span><span style=3D"color: rgb(102, 102, 0);">;</span><span =
style=3D"color: rgb(0, 0, 0);"> pUnicast </span><span style=3D"color: rgb(1=
02, 102, 0);">!=3D</span><span style=3D"color: rgb(0, 0, 0);"> NULL</span><=
span style=3D"color: rgb(102, 102, 0);">;</span><span style=3D"color: rgb(0=
, 0, 0);"><br>=C2=A0 pUnicast </span><span style=3D"color: rgb(102, 102, 0)=
;">=3D</span><span style=3D"color: rgb(0, 0, 0);"> pUnicast</span><span sty=
le=3D"color: rgb(102, 102, 0);">-&gt;</span><span style=3D"color: rgb(102, =
0, 102);">Next</span><span style=3D"color: rgb(102, 102, 0);">;</span><span=
 style=3D"color: rgb(0, 0, 0);"> i</span><span style=3D"color: rgb(102, 102=
, 0);">++)</span></div></code></div></div></div></blockquote><div><br>This =
puts all of the iteration logic in the same place: the `for` statement itse=
lf. So if you want to see what happens on each loop, you don&#39;t have to =
look at both the top and the bottom of the `for` statement.</div><div><br><=
/div><div>Yes that is the problem,=C2=A0but I don&#39;t like the existing f=
or loops syntax, so I&#39;m not sure it&#39;s meaningful to propose that ba=
ck to me, especially when my proposal also catered for the logic being at t=
he top of the loop. See:</div><div><br></div><div><div style=3D"border: 1px=
 solid rgb(187, 187, 187); border-image: none; -ms-word-wrap: break-word; b=
ackground-color: rgb(250, 250, 250);"><code><div><span style=3D"color: rgb(=
0, 0, 136);">for</span><span style=3D"color: rgb(0, 0, 0);"> </span><span s=
tyle=3D"color: rgb(102, 102, 0);">(</span><span style=3D"color: rgb(0, 0, 0=
);"> </span><span style=3D"color: rgb(0, 0, 136);">int</span><span style=3D=
"color: rgb(0, 0, 0);"> i </span><span style=3D"color: rgb(102, 102, 0);">=
=3D</span><span style=3D"color: rgb(0, 0, 0);"> </span><span style=3D"color=
: rgb(0, 102, 102);">0</span><span style=3D"color: rgb(102, 102, 0);">;</sp=
an><span style=3D"color: rgb(0, 0, 0);"> pUnicast </span><span style=3D"col=
or: rgb(102, 102, 0);">!=3D</span><span style=3D"color: rgb(0, 0, 0);"> NUL=
L; </span><span style=3D"color: rgb(102, 102, 0);">)</span></div></code></d=
iv></div><div>{</div><div>=C2=A0=C2=A0continue {</div><div><font color=3D"#=
000000">=C2=A0 pUnicast </font><span style=3D"color: rgb(102, 102, 0);">=3D=
</span><span style=3D"color: rgb(0, 0, 0);"> pUnicast</span><span style=3D"=
color: rgb(102, 102, 0);">-&gt;</span><span style=3D"color: rgb(102, 0, 102=
);">Next;</span></div><div><span style=3D"color: rgb(102, 0, 102);">=C2=A0 =
++I;</span></div><div><span style=3D"color: rgb(102, 0, 102);">=C2=A0=C2=A0=
}</span></div><div><span style=3D"color: rgb(102, 0, 102);">// whatever</sp=
an></div><div><span style=3D"color: rgb(102, 0, 102);">}</span></div><p><sp=
an style=3D"color: rgb(102, 0, 102);"><br></span></p>I&#39;m hearing you do=
n&#39;t like my proposed syntax.=C2=A0let&#39;s=C2=A0find a better one then=
.. You are currently holding onto the existing syntax and I don&#39;t find t=
hat superior to my suggestion for anything but the most trivial of situatio=
ns. I&#39;m looking for something that scales better for the non trivial si=
tuations.<br><br><br>Thanks<div><br></div></div>

<p></p>

-- <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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/2e118de4-f49a-4c12-b0d3-d881d3660d43%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/2e118de4-f49a-4c12-b0d3-d881d3660d43=
%40isocpp.org</a>.<br />

------=_Part_1434_234713489.1469481132284--

------=_Part_1433_102576338.1469481132284--

.
