220 27264 <c60fad22-94ab-4ba7-9341-211887ce853a@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: gmisocpp@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: loop continuation code
Date: Mon, 25 Jul 2016 20:26:54 -0700 (PDT)
Lines: 275
Approved: news@gmane.org
Message-ID: <c60fad22-94ab-4ba7-9341-211887ce853a@isocpp.org>
References: <2f575934-e078-411c-9c8a-c2996da7609d@isocpp.org>
 <28358863-5be0-401a-893a-0ae5385156c2@isocpp.org>
 <8ee79066-43c5-4624-8fb5-01172eb36d29@isocpp.org>
 <c0a2a265-9128-490c-b80e-d9f7438df92a@isocpp.org>
 <faae92a3-7756-bc06-20cd-69526d3160fe@gmail.com>
 <be336fa1-7a36-4a47-903e-25246fa254be@isocpp.org>
 <3326b130-cb6a-4c10-a804-6e236f12ec9e@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_355_1498135266.1469503614712"
X-Trace: ger.gmane.org 1469503633 2222 80.91.229.3 (26 Jul 2016 03:27:13 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 26 Jul 2016 03:27:13 +0000 (UTC)
Cc: gmisocpp@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCM3TRNUXUDBB75Q3O6AKGQEVWNZLLY@isocpp.org Tue Jul 26 05:27:01 2016
Return-path: <std-proposals+bncBCM3TRNUXUDBB75Q3O6AKGQEVWNZLLY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qt0-f199.google.com ([209.85.216.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCM3TRNUXUDBB75Q3O6AKGQEVWNZLLY@isocpp.org>)
	id 1bRt1I-00022L-D8
	for gclcip-std-proposals@m.gmane.org; Tue, 26 Jul 2016 05:27:00 +0200
Original-Received: by mail-qt0-f199.google.com with SMTP id q11sf420089258qtb.1
        for <gclcip-std-proposals@m.gmane.org>; Mon, 25 Jul 2016 20:27:00 -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=Qah/OiVxP24w5h3K6J5TbWSJ9exBX9SRtYNsHrXqKxQ=;
        b=ePVTpnq5AvVFxb+kpjUPEZYkaDFhG3N6Q8U/jlq8zkgelK/iy5maTn5gE2ymmfarrG
         61vf3xJoMz0CY51IBG8ubm3IhJ5fRNKMBbFr0dcMY84F5OWHCrX6Bt+ZGd3IrPHhPYu/
         6HPVl9KCI4EUG/d33ZtosirRNMHkINKiDWRnrYeJy7H/svcMiR30ganSYhQ0g1fD7yki
         VnZI8CraX5OAGyIQ1PA4f9CtgipXsBexuzwPu90PRPmuTdomVaGbuJJqiKcFYqnHtr9Q
         g8lWc2D4D8ua0S+wkJz8J4W8lMx6faPAcGAxdlr4ck7jXO9Juiqq5F83J8SXiFFgfD79
         6UUg==
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=Qah/OiVxP24w5h3K6J5TbWSJ9exBX9SRtYNsHrXqKxQ=;
        b=l+rK/Yerc7gt7fPjo2ZX+gSVhf4225hivL4mk8yaTMB37Hrqo+PZOEbISakcaEYeSZ
         O8MkwBe9RqoZRMyvEa5W4gjb/cO1lkWmvZFwQHBFufIhteAJH1peYMVGDSriqreX5Pbo
         WcIpC5mHTUCDeub2GnUxJaAPVCRKtiCwKz4arEQVnOm8kGAau2jgY5+ZruTgFMno8KT4
         i8uOAqLW8vRepLDQB2SjLFgBaLQehFh1vL5E8Htxm5iaiuhtjTBSsKZ4YcIQA//HpKON
         Z3ze7QgQO1Aj/YIAj/paoI6hzG1NTeRY7R0bktXig1rgRcCr9sIyxiYcWGor9hLZojEw
         YzHQ==
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=Qah/OiVxP24w5h3K6J5TbWSJ9exBX9SRtYNsHrXqKxQ=;
        b=Zs4x52IhHf8GBwduLjy1ZBc4zz4/5toaIKK0pIRM++vTNV3tyx5jISZbRHb0mD8uWr
         ZP+YyJmGuqRnfofd7ErtCtydheZ7GXl4TxKU7YKWB/AvhMHQDlG9aAJQ/cgwWuBJhxfM
         ocFT9/yvR5SDYIQ7F23Hy3Z4sV3Cm1NsVRiQDB1XK4ysdunQyHhr4emKhQkR7Wn5nzdo
         eEyK0K8nTAfmdfnpwFNpg4++XyGvv2m20wek2/svHWqUT05xwTLjcB+/XGTPZM3v62bl
         9D1mw769pP+0oaSC1h3cPChXP4nCaBu76qnGxoOwLYVXtFY7ZvfhWQuh3WJ1hbAo0XKD
         rvgA==
X-Gm-Message-State: AEkoouuoNaH+23ywy9SftV6D4QMKUTXn6VdincTK9thYza+0xT4HJgb9K3h2ZTVs6qP1pA==
X-Received: by 10.176.1.239 with SMTP id 102mr18558748ual.7.1469503619588;
        Mon, 25 Jul 2016 20:26:59 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.183.203 with SMTP id h194ls3861591iof.34.gmail; Mon, 25
 Jul 2016 20:26:55 -0700 (PDT)
X-Received: by 10.36.50.75 with SMTP id j72mr3376077ita.5.1469503615554;
        Mon, 25 Jul 2016 20:26:55 -0700 (PDT)
In-Reply-To: <3326b130-cb6a-4c10-a804-6e236f12ec9e@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:27264
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/27264>

------=_Part_355_1498135266.1469503614712
Content-Type: multipart/alternative; 
	boundary="----=_Part_356_1686157258.1469503614712"

------=_Part_356_1686157258.1469503614712
Content-Type: text/plain; charset=UTF-8

Hi Nicol
 

>
>>
> I fail to see how that is in any way better syntax than what I suggested. 
> Indeed, it's worse because it gives the writer the choice of where this 
> "continue" block is.
>
> A reader of a `for` loop should not have to scan through the loop's body 
> just to find out how it iterates through its stuff.
>

Why don't you actually read what I said in my proposal instead of randomly 
making stuff up and being patronising?
I never said a user should "have to" do anything. What I actually said was 
the notion of a continue block supports being anywhere so the concept 
supports being as flexible as people like, but I'd like people to vote 
for where they'd like it to go. I get you'd like it at the beginning, 
great, me too! But let's not keep attributing me to something I didn't say. 
For someone who doesn't like "scanning" you seem to be doing a lot of it.

 

>
> 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.
>>
>
> What is a "non-trivial situation"? That's kinds the problem with your 
> idea: this use case simply doesn't happen *that* often.
>

I never said it did happen *all that often*.
 

>
> `for` is nothing more than syntactic sugar for `while`. But most of us use 
> `for` more often than `while`, so that proves the usefulness of the 
> syntactic sugar. Range-based `for` is the same way; it's exceptionally 
> handy in a lot of cases.
>
> Most uses of `for` loops are just fine with a simple iteration statement. 
> The number of times when a `for` loop gets so complex that you need 
> multiple counter *statements* (not just expressions but actual 
> statements) is quite low.
>
> In those cases, `goto` is the proper tool. That's why we keep it around, 
> after all. Not because it's useful most of the time. Or some of the time. 
> Or even rarely. But for that 1:10000 case when we have to do something 
> unorthodox, something that our existing abstractions cannot cleanly handle. 
> We take the tool off the shelf and use it to get things done in a 
> reasonable way.
>

I explained why I think goto isn't sufficing here. Look at the people who 
wanted to rewrite the original sample (from reddit) without the goto. goto 
attracts so much hate it gets attacked even when it is appropriate. This 
idea was to help in those cases an alternative to side step some of that. 
If you don't think so, that's ok.
 
 

>
> We should not add syntax for exceptionally rare circumstances. Indeed, in 
> code review, if there was no legitimate way to clean up that loop, I would 
> prefer that it be written as a `while` loop, thus *forcing* the coding 
> style. By doing so, we make it abundantly clear that the loop's logic 
> doesn't follow the standard `for` rules. `for` exists for trivial 
> circumstances; if your circumstances are non-trivial, then it's simply the 
> wrong tool.
>
> On Monday, July 25, 2016 at 9:52:51 PM UTC-4, gmis...@gmail.com wrote:
>>
>>
>>> The thing is that papers proposing language changes always need a pretty 
>>> good and convincing motivation section that clearly shows how the language 
>>> feature improves the status-quo. "... I have myself in the past written 
>>> loops where ..." doesn't really cut it without showing (optimally real 
>>> world) examples where any other alternative using existing language (or 
>>> even other proposals) is inferior. You have to convince some 100+ experts 
>>> that your feature is the way to go and have answers prepared for the 
>>> inevitable opposition/criticism.
>>>
>>>
>> For anyone who has encountered the problem themselves AND sees it as a 
>> sufficient problem I'm sure they can imagine a motivating case already. If 
>> not, they are simply in the set of people who don't find this issue 
>> motivating, so they never will be. Let's be realistic. I'm ok with that. 
>> And in any case I'm not going to create an implementation or do any other 
>> things that people might have on there wish list, I'm just throwing the 
>> idea out there and if that motivates an expert to run with the idea great, 
>> if not, that's ok too as I'm sure there time is more valuable than mine. 
>> But I don't buy that imagination here is the problem. So you're one of the 
>> people unmotivated by the idea, I'm ok with that. But let's not pretend 
>> anything would convince you I think you are kidding yourself.
>>
>
> So your response to being asked to provide motivation for your proposal is 
> to simply claim that people who are asking for it will never understand. so 
> there's no point in giving it to them. I can't say that I find such an 
> "argument" convincing...
>

Don't be convinced then, that's ok. But I'm also allowed to find it 
unconvincing that anything will convince you and that's my prerogative too 
because this isn't a rocket science suggestion regardless of whatever 
rocket science you think it needs to back it up. It was an off the cuff 
idea and I've claimed no great effort to sell it as anything more 
than that. So how about next time you at least make an effort to read what 
I actually wrote to begin with before patronising me or attributing things 
to me that I didn't say like where you "have to" put the continue block. It 
seems you have no ability to add to or mould an idea or even gently inquire 
about it, only just nuke everything from a great height. I don't find that 
approach very convincing to anything no matter how smart you are.

-- 
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/c60fad22-94ab-4ba7-9341-211887ce853a%40isocpp.org.

------=_Part_356_1686157258.1469503614712
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi Nicol</div><div>=C2=A0</div><blockquote class=3D"g=
mail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-l=
eft-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: s=
olid;"><div dir=3D"ltr"><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>=
<span style=3D"color: rgb(102, 0, 102);"><br></span></div></div></blockquot=
e><div><br>I fail to see how that is in any way better syntax than what I s=
uggested. Indeed, it&#39;s worse because it gives the writer the choice of =
where this &quot;continue&quot; block is.<br><br>A reader of a `for` loop s=
hould not have to scan through the loop&#39;s body just to find out how it =
iterates through its stuff.<br></div></div></blockquote><div><br></div><div=
>Why don&#39;t you actually read what I said in my proposal instead of rand=
omly making stuff up and being patronising?</div><div>I never said a user s=
hould &quot;have to&quot; do anything. What I actually said was the notion =
of a=C2=A0continue=C2=A0block supports being anywhere=C2=A0so the concept s=
upports being as=C2=A0flexible as people like,=C2=A0but I&#39;d like people=
 to=C2=A0vote for=C2=A0where they&#39;d like it to go. I get you&#39;d like=
 it at the beginning, great, me too! But let&#39;s not keep attributing me =
to something I didn&#39;t say. For someone who doesn&#39;t like &quot;scann=
ing&quot; you seem to be doing a lot of it.</div><div><br></div><div>=C2=A0=
</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-widt=
h: 1px; border-left-style: solid;"><div dir=3D"ltr"><div><br></div><blockqu=
ote 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"><p><span style=3D"color: rgb(102, 0, =
102);"></span></p>I&#39;m
 hearing you don&#39;t like my proposed syntax.=C2=A0let&#39;s=C2=A0find a =
better one=20
then. You are currently holding onto the existing syntax and I don&#39;t=20
find that superior to my suggestion for anything but the most trivial of
 situations. I&#39;m looking for something that scales better for the non=
=20
trivial situations.<br></div></blockquote><div><br>What is a &quot;non-triv=
ial situation&quot;? That&#39;s kinds the problem with your idea: this use =
case simply doesn&#39;t happen *that* often.<br></div></div></blockquote><d=
iv><br></div><div>I never said it did happen *all that often*.</div><div>=
=C2=A0</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-lef=
t-width: 1px; border-left-style: solid;"><div dir=3D"ltr"><div><br>`for` is=
 nothing more than syntactic sugar for `while`. But most of us use `for` mo=
re often than `while`, so that proves the usefulness of the syntactic sugar=
.. Range-based `for` is the same way; it&#39;s exceptionally handy in a lot =
of cases.<br><br>Most uses of `for` loops are just fine with a simple itera=
tion statement. The number of times when a `for` loop gets so complex that =
you need multiple counter <i>statements</i> (not just expressions but actua=
l statements) is quite low.<br><br>In those cases, `goto` is the proper too=
l. That&#39;s why we keep it around, after all. Not because it&#39;s useful=
 most of the time. Or some of the time. Or even rarely. But for that 1:1000=
0 case when we have to do something unorthodox, something that our existing=
 abstractions cannot cleanly handle. We take the tool off the shelf and use=
 it to get things done in a reasonable way.<br></div></div></blockquote><di=
v><br></div><div><div>I explained why I think goto isn&#39;t sufficing here=
..=C2=A0Look at the people who wanted to rewrite the original sample (from r=
eddit) without the goto. goto attracts so much hate it gets attacked even w=
hen it is appropriate. This idea was to help in those cases an alternative =
to side step some of that. If you don&#39;t think so, that&#39;s ok.</div>=
=C2=A0</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"mar=
gin: 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><br>We should not add syntax for exceptionally rare circumstances. Ind=
eed, in code review, if there was no legitimate way to clean up that loop, =
I would prefer that it be written as a `while` loop, thus <i>forcing</i> th=
e coding style. By doing so, we make it abundantly clear that the loop&#39;=
s logic doesn&#39;t follow the standard `for` rules.  `for` exists for triv=
ial circumstances; if your circumstances are non-trivial, then it&#39;s sim=
ply the wrong tool.<br></div><br>On Monday, July 25, 2016 at 9:52:51 PM UTC=
-4, <a>gmis...@gmail.com</a> wrote:<blockquote class=3D"gmail_quote" style=
=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(20=
4, 204, 204); border-left-width: 1px; border-left-style: solid;"><div dir=
=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8=
ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-w=
idth: 1px; border-left-style: solid;"><div text=3D"#000000" bgcolor=3D"#FFF=
FFF"><blockquote type=3D"cite"><div dir=3D"ltr"><div><br></div>
      </div>
    </blockquote>
    The thing is that papers proposing language changes always need a
    pretty good and convincing motivation section that clearly shows how
    the language feature improves the status-quo. &quot;... I have myself i=
n
    the past written loops where ...&quot; doesn&#39;t really cut it withou=
t
    showing (optimally real world) examples where any other alternative
    using existing language (or even other proposals) is inferior. You
    have to convince some 100+ experts that your feature is the way to
    go and have answers prepared for the inevitable
    opposition/criticism.<br>
    <br></div></blockquote><div><br></div><div>For anyone who has encounter=
ed the problem themselves=C2=A0AND sees it as a sufficient problem I&#39;m =
sure they can imagine a=C2=A0motivating case already. If not,=C2=A0they are=
 simply in the set of people who don&#39;t find this issue motivating, so t=
hey=C2=A0never will be. Let&#39;s be realistic. I&#39;m ok with that. And i=
n any case I&#39;m not going to create an implementation or do any other th=
ings that people might have on there wish list, I&#39;m just throwing the i=
dea out there and if that motivates an expert to run with the idea great, i=
f not, that&#39;s ok too as=C2=A0I&#39;m sure there time is more valuable t=
han mine. But I don&#39;t buy that imagination here is the problem. So you&=
#39;re one of the people unmotivated by the idea, I&#39;m ok with that. But=
 let&#39;s not pretend anything would convince you I think you are kidding =
yourself.</div></div></blockquote><div><br>So your response to being asked =
to provide motivation for your proposal is to simply claim that people who =
are asking for it will never understand. so there&#39;s no point in giving =
it to them. I can&#39;t say that I find such an &quot;argument&quot; convin=
cing...<br></div></div></blockquote><div><br></div><div>Don&#39;t be convin=
ced then, that&#39;s ok.=C2=A0But=C2=A0I&#39;m also allowed=C2=A0to find it=
 unconvincing=C2=A0that anything will convince you=C2=A0and that&#39;s=C2=
=A0my prerogative too because=C2=A0this isn&#39;t a rocket science suggesti=
on regardless of whatever rocket science you think=C2=A0it needs to back it=
 up.=C2=A0It was an off the cuff idea and I&#39;ve claimed no great effort =
to sell it as anything more than=C2=A0that. So how about next time=C2=A0you=
=C2=A0at least make an effort to read what I actually wrote to begin with b=
efore patronising me or attributing=C2=A0things to me that I didn&#39;t say=
 like where you &quot;have to&quot; put the continue=C2=A0block. It seems y=
ou have no ability to add to or mould an idea or even gently inquire about =
it, only just nuke everything from a great height. I don&#39;t find that ap=
proach very convincing to anything no matter how smart you are.</div><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/c60fad22-94ab-4ba7-9341-211887ce853a%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/c60fad22-94ab-4ba7-9341-211887ce853a=
%40isocpp.org</a>.<br />

------=_Part_356_1686157258.1469503614712--

------=_Part_355_1498135266.1469503614712--

.
