Topic: loop continuation code
Author: gmisocpp@gmail.com
Date: Sun, 24 Jul 2016 23:40:42 -0700 (PDT)
Raw View
------=_Part_3877_385495871.1469428842367
Content-Type: multipart/alternative;
boundary="----=_Part_3878_1277267587.1469428842367"
------=_Part_3878_1277267587.1469428842367
Content-Type: text/plain; charset=UTF-8
Hi
I was recently reading a reddit article where a piece of code like this
appeared:
for ( int i = 0; pUnicast != NULL; i++ )
{
Address address( (sockaddr_storage*) pUnicast->Address.lpSockaddr );
if ( !address.IsValid() )
goto next_unicast;
if ( address.IsLoopback() )
goto next_unicast;
if ( address.GetType() == ADDRESS_IPV6 && !address.IsGlobalUnicast() )
goto next_unicast;
addresses[numAddresses++] = address;
if ( numAddresses >= maxAddresses )
break;
next_unicast:
pUnicast = pUnicast->Next;
}
A common response to the article was to immediately attack the code and
re-write it without using goto because people considered it sloppy. This
got me thinking about a few things:
#1 It reminded me how fearful people are of goto so that they won't use it
even if it's appropriate; and not only that, but they will also
re-write other peoples code using goto to avoid it even if it isn't a big
deal. The example loop above isn't that unreasonable especially if you
imagine you might want to add additional statements later at the goto
target point. That then brings me to my main point:
#2 Sometimes I want to execute the same set of code on continuation and
putting it all in the increment section of the loop isn't that nice or even
realistic. But using a goto isn't that nice either or having someone
re-write code just because *they* don't like goto.
Proposal:
If we had a special continue block in the language, these problems wouldn't
exist because we could re-write the above loop like so:
for ( int i = 0; pUnicast != NULL; i++ )
{
Address address( (sockaddr_storage*) pUnicast->Address.lpSockaddr );
if ( !address.IsValid() )
continue; // goto the continue block below
if ( address.IsLoopback() )
continue;
if ( address.GetType() == ADDRESS_IPV6 && !address.IsGlobalUnicast() )
continue;
addresses[numAddresses++] = address;
if ( numAddresses >= maxAddresses )
break;
continue
{
// Whatever else you like here.
pUnicast = pUnicast->Next
} // on normal exit goto the regular continue point of the loop.
}
This seems useful to me and would solve the points mentioned above and it
could be added without introducing any new keywords. It
would make goto even less useful and allow use in multiple loops without
having to makeup random label names etc.
The continue block might be better outside of the loop to avoid excessive
indentation or at the start inside the loop for clarity. It might also need
some re-jigging to get the syntax to play nicely with the "for else" type
suggestions I've seen, so bare that in mind too when thinking about this.
But you get the basic idea.
I'd appreciate peoples thoughts on the merit of the core idea first and
then where they think the continuation block should go.
I expect this feature if adopted would to be available in while and do
loops etc. too.
Thanks
GM
--
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/2f575934-e078-411c-9c8a-c2996da7609d%40isocpp.org.
------=_Part_3878_1277267587.1469428842367
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Hi</div><div><br></div><div>I was recently reading a =
reddit article where a piece of code=C2=A0like this appeared:</div><div><br=
></div><div>for ( int i =3D 0; pUnicast !=3D NULL; i++ )<br>{<br>=C2=A0=C2=
=A0 Address address( (sockaddr_storage*) pUnicast->Address.lpSockaddr );=
<br><br>=C2=A0=C2=A0 if ( !address.IsValid() )<br>=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 goto next_unicast;<br><br>=C2=A0=C2=A0 if ( address.IsLoopback() )<b=
r>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto next_unicast;<br><br>=C2=A0=C2=A0 if =
( address.GetType() =3D=3D ADDRESS_IPV6 && !address.IsGlobalUnicast=
() )<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto next_unicast;<br><br>=C2=A0=C2=
=A0 addresses[numAddresses++] =3D address;<br><br>=C2=A0=C2=A0 if ( numAddr=
esses >=3D maxAddresses )<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break;<br><b=
r>next_unicast:<br><br>=C2=A0=C2=A0 pUnicast =3D pUnicast->Next;<br></di=
v><div>}</div><div><br></div><div>A common=C2=A0response to the article was=
to immediately attack the code and re-write it without using goto because =
people considered it sloppy. This got me thinking about a few things:</div>=
<div><br></div><div>#1 It reminded me=C2=A0how fearful people are=C2=A0of g=
oto so that they won't use it even if it's appropriate;=C2=A0and no=
t only that, but they=C2=A0will also re-write=C2=A0other peoples code=C2=A0=
using goto=C2=A0to avoid it even if it isn't a big deal. The example lo=
op above isn't that unreasonable=C2=A0especially if you imagine you mig=
ht want to add additional statements later at the goto target point. That t=
hen brings me to my main point:</div><div><br></div><div>#2=C2=A0Sometimes =
I want to=C2=A0execute=C2=A0the same=C2=A0set of=C2=A0code on continuation =
and putting it all in the increment section of the loop isn't that nice=
or even realistic. But using a goto isn't that nice either or having s=
omeone re-write=C2=A0code just because *they* don't like goto.</div><di=
v><br></div><div>Proposal:</div><div>If we had a special continue block in =
the language, these problems wouldn't exist because=C2=A0we could re-wr=
ite the above loop=C2=A0like=C2=A0so:=C2=A0</div><div><br></div><div>for ( =
int i =3D 0; pUnicast !=3D NULL; i++ )<br>{<br>=C2=A0=C2=A0 Address address=
( (sockaddr_storage*) pUnicast->Address.lpSockaddr );<br><br>=C2=A0=C2=
=A0 if ( !address.IsValid() )<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 continue; /=
/ goto the continue block below<br><br>=C2=A0=C2=A0 if ( address.IsLoopback=
() )<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 continue;<br><br>=C2=A0=C2=A0 if ( a=
ddress.GetType() =3D=3D ADDRESS_IPV6 && !address.IsGlobalUnicast() =
)<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 continue;<br><br>=C2=A0=C2=A0 addresses=
[numAddresses++] =3D address;<br><br>=C2=A0=C2=A0 if ( numAddresses >=3D=
maxAddresses )<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break;<br><br>=C2=A0=C2=
=A0 continue</div><div>=C2=A0=C2=A0 {</div><div>=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 // Whatever else you like here.<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 pUnicast =3D pUnicast->Next</div><div>=C2=A0=C2=A0=C2=A0} // on n=
ormal exit goto the regular continue point of the loop.<br></div><div>}</di=
v><div><br></div><div>This seems=C2=A0useful to me and would solve the poin=
ts mentioned above and=C2=A0it could be added without introducing any new k=
eywords.=C2=A0It would=C2=A0make=C2=A0goto=C2=A0even less useful and allow =
use=C2=A0in multiple loops=C2=A0without having to makeup=C2=A0random label =
names etc.=C2=A0</div><div><br></div><div>The continue block=C2=A0might be =
better=C2=A0outside of=C2=A0the loop to avoid excessive indentation=C2=A0or=
at the start inside the loop for clarity.=C2=A0It=C2=A0might also need som=
e re-jigging to get=C2=A0the syntax to play nicely with the "for else&=
quot; type suggestions I've seen, so bare that in mind too when thinkin=
g about this. But you get the basic idea.</div><div><br></div><div>I'd =
appreciate peoples thoughts on the merit of the core=C2=A0idea first and th=
en=C2=A0where they think the continuation block should go.</div><div><br></=
div><div><div><div>I expect=C2=A0this feature if adopted would=C2=A0to be a=
vailable in while and do loops etc. too.</div></div></div><div><br></div><d=
iv>Thanks</div><div>GM<br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/2f575934-e078-411c-9c8a-c2996da7609d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/2f575934-e078-411c-9c8a-c2996da7609d=
%40isocpp.org</a>.<br />
------=_Part_3878_1277267587.1469428842367--
------=_Part_3877_385495871.1469428842367--
.
Author: "D. B." <db0451@gmail.com>
Date: Mon, 25 Jul 2016 09:44:57 +0100
Raw View
--047d7b6d9bfa8a5dda053871ccdf
Content-Type: text/plain; charset=UTF-8
duplicate of
https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/4c0e87f0-5b39-4922-8028-671fd50361b6%40isocpp.org?utm_medium=email&utm_source=footer
searching before posting helps ;-)
--
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/CACGiwhFOEwP6AbZ673N-mr6nq6nL5RU-a5vp%2B3%2BJA%3DfuuPYOOw%40mail.gmail.com.
--047d7b6d9bfa8a5dda053871ccdf
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>duplicate of <a href=3D"https://groups.google.com/a/i=
socpp.org/d/msgid/std-proposals/4c0e87f0-5b39-4922-8028-671fd50361b6%40isoc=
pp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.co=
m/a/isocpp.org/d/msgid/std-proposals/4c0e87f0-5b39-4922-8028-671fd50361b6%4=
0isocpp.org?utm_medium=3Demail&utm_source=3Dfooter</a></div><div><br></=
div><div>searching before posting helps ;-)</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" 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/CACGiwhFOEwP6AbZ673N-mr6nq6nL5RU-a5vp=
%2B3%2BJA%3DfuuPYOOw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoote=
r">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CACGiwhFOEw=
P6AbZ673N-mr6nq6nL5RU-a5vp%2B3%2BJA%3DfuuPYOOw%40mail.gmail.com</a>.<br />
--047d7b6d9bfa8a5dda053871ccdf--
.
Author: =?UTF-8?Q?Jonathan_M=C3=BCller?= <jonathanmueller.dev@gmail.com>
Date: Mon, 25 Jul 2016 10:51:10 +0200
Raw View
--001a114c93b0cabc8d053871e2a3
Content-Type: text/plain; charset=UTF-8
On Jul 25, 2016 10:45, "D. B." <db0451@gmail.com> wrote:
>
> duplicate of
https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/4c0e87f0-5b39-4922-8028-671fd50361b6%40isocpp.org?utm_medium=email&utm_source=footer
>
> searching before posting helps ;-)
How is that a duplicate? That proposal wants different code executed on the
various *break* conditions, this on a *continue*. He even mentions that
proposal(s).
--
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/CAEddoJa7XaJZYua_ZaSecwooZz_FJdCfhCfPTmAcq3NY%3DMEzQQ%40mail.gmail.com.
--001a114c93b0cabc8d053871e2a3
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<p dir=3D"ltr">On Jul 25, 2016 10:45, "D. B." <<a href=3D"mail=
to:db0451@gmail.com">db0451@gmail.com</a>> wrote:<br>
><br>
> duplicate of <a href=3D"https://groups.google.com/a/isocpp.org/d/msgid=
/std-proposals/4c0e87f0-5b39-4922-8028-671fd50361b6%40isocpp.org?utm_medium=
=3Demail&utm_source=3Dfooter">https://groups.google.com/a/isocpp.org/d/=
msgid/std-proposals/4c0e87f0-5b39-4922-8028-671fd50361b6%40isocpp.org?utm_m=
edium=3Demail&utm_source=3Dfooter</a><br>
><br>
> searching before posting helps ;-)</p>
<p dir=3D"ltr">How is that a duplicate? That proposal wants different code =
executed on the various *break* conditions, this on a *continue*. He even m=
entions that proposal(s).</p>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/CAEddoJa7XaJZYua_ZaSecwooZz_FJdCfhCfP=
TmAcq3NY%3DMEzQQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAEddoJa7XaJZYu=
a_ZaSecwooZz_FJdCfhCfPTmAcq3NY%3DMEzQQ%40mail.gmail.com</a>.<br />
--001a114c93b0cabc8d053871e2a3--
.
Author: "D. B." <db0451@gmail.com>
Date: Mon, 25 Jul 2016 10:18:28 +0100
Raw View
--047d7b6d9bfa77de760538724420
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Mon, Jul 25, 2016 at 9:51 AM, Jonathan M=C3=BCller <
jonathanmueller.dev@gmail.com> wrote:
> How is that a duplicate? That proposal wants different code executed on
> the various *break* conditions, this on a *continue*. He even mentions th=
at
> proposal(s).
>
It seems like a direct extension of the same idea, and lorro mentioned
continue in that proposal while discussing how it's quite open-ended in
terms of all the 'catch blocks' it could potentially handle. But ymmv.
--=20
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 e=
mail 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/CACGiwhGcFZu37DX%2B8m_TsB0RjbDEeKVR6ie6Ui9DVNhwY=
t3RSw%40mail.gmail.com.
--047d7b6d9bfa77de760538724420
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On M=
on, Jul 25, 2016 at 9:51 AM, Jonathan M=C3=BCller <span dir=3D"ltr"><<a =
href=3D"mailto:jonathanmueller.dev@gmail.com" target=3D"_blank">jonathanmue=
ller.dev@gmail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quot=
e" 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"><p dir=3D"ltr"=
>How is that a duplicate? That proposal wants different code executed on th=
e various *break* conditions, this on a *continue*. He even mentions that p=
roposal(s).</p></blockquote><div>It seems=C2=A0like a direct=C2=A0extension=
of the same idea, and=C2=A0lorro mentioned continue in that proposal while=
discussing how it's quite open-ended in terms of all the 'catch bl=
ocks' it could potentially handle. But ymmv.</div><div><br></div></div>=
</div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/CACGiwhGcFZu37DX%2B8m_TsB0RjbDEeKVR6i=
e6Ui9DVNhwYt3RSw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CACGiwhGcFZu37D=
X%2B8m_TsB0RjbDEeKVR6ie6Ui9DVNhwYt3RSw%40mail.gmail.com</a>.<br />
--047d7b6d9bfa77de760538724420--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Mon, 25 Jul 2016 08:08:22 -0700 (PDT)
Raw View
------=_Part_231_358107579.1469459302807
Content-Type: multipart/alternative;
boundary="----=_Part_232_1905488901.1469459302808"
------=_Part_232_1905488901.1469459302808
Content-Type: text/plain; charset=UTF-8
On Monday, July 25, 2016 at 2:40:42 AM UTC-4, gmis...@gmail.com wrote:
>
> Hi
>
> I was recently reading a reddit article where a piece of code like this
> appeared:
>
> for ( int i = 0; pUnicast != NULL; i++ )
> {
> Address address( (sockaddr_storage*) pUnicast->Address.lpSockaddr );
>
> if ( !address.IsValid() )
> goto next_unicast;
>
> if ( address.IsLoopback() )
> goto next_unicast;
>
> if ( address.GetType() == ADDRESS_IPV6 && !address.IsGlobalUnicast() )
> goto next_unicast;
>
> addresses[numAddresses++] = address;
>
> if ( numAddresses >= maxAddresses )
> break;
>
> next_unicast:
>
> pUnicast = pUnicast->Next;
> }
>
> A common response to the article was to immediately attack the code and
> re-write it without using goto because people considered it sloppy. This
> got me thinking about a few things:
>
> #1 It reminded me how fearful people are of goto so that they won't use it
> even if it's appropriate; and not only that, but they will also
> re-write other peoples code using goto to avoid it even if it isn't a big
> deal. The example loop above isn't that unreasonable especially if you
> imagine you might want to add additional statements later at the goto
> target point. That then brings me to my main point:
>
> #2 Sometimes I want to execute the same set of code on continuation and
> putting it all in the increment section of the loop isn't that nice or even
> realistic. But using a goto isn't that nice either or having someone
> re-write code just because *they* don't like goto.
>
> Proposal:
> If we had a special continue block in the language, these problems
> wouldn't exist because we could re-write the above loop like so:
>
> for ( int i = 0; pUnicast != NULL; i++ )
> {
> Address address( (sockaddr_storage*) pUnicast->Address.lpSockaddr );
>
> if ( !address.IsValid() )
> continue; // goto the continue block below
>
> if ( address.IsLoopback() )
> continue;
>
> if ( address.GetType() == ADDRESS_IPV6 && !address.IsGlobalUnicast() )
> continue;
>
> addresses[numAddresses++] = address;
>
> if ( numAddresses >= maxAddresses )
> break;
>
> continue
> {
> // Whatever else you like here.
> pUnicast = pUnicast->Next
> } // on normal exit goto the regular continue point of the loop.
> }
>
> This seems useful to me and would solve the points mentioned above and it
> could be added without introducing any new keywords. It
> would make goto even less useful and allow use in multiple loops without
> having to makeup random label names etc.
>
> The continue block might be better outside of the loop to avoid excessive
> indentation or at the start inside the loop for clarity. It might also need
> some re-jigging to get the syntax to play nicely with the "for else" type
> suggestions I've seen, so bare that in mind too when thinking about this.
> But you get the basic idea.
>
> I'd appreciate peoples thoughts on the merit of the core idea first and
> then where they think the continuation block should go.
>
> I expect this feature if adopted would to be available in while and do
> loops etc. too.
>
> Thanks
> GM
>
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.
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++)
{
Address address( (sockaddr_storage*) pUnicast->Address.lpSockaddr );
if ( !address.IsValid() )
continue; // goto the continue block below
if ( address.IsLoopback() )
continue;
if ( address.GetType() == ADDRESS_IPV6 && !address.IsGlobalUnicast() )
continue;
addresses[numAddresses++] = address;
if ( numAddresses >= maxAddresses )
break;
}
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.
--
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/28358863-5be0-401a-893a-0ae5385156c2%40isocpp.org.
------=_Part_232_1905488901.1469459302808
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Monday, July 25, 2016 at 2:40:42 AM UTC-4, gmis...@gmai=
l.com wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-lef=
t: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><=
div>Hi</div><div><br></div><div>I was recently reading a reddit article whe=
re a piece of code=C2=A0like this appeared:</div><div><br></div><div>for ( =
int i =3D 0; pUnicast !=3D NULL; i++ )<br>{<br>=C2=A0=C2=A0 Address address=
( (sockaddr_storage*) pUnicast->Address.lpSockaddr );<br><br>=C2=A0=C2=
=A0 if ( !address.IsValid() )<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto next_u=
nicast;<br><br>=C2=A0=C2=A0 if ( address.IsLoopback() )<br>=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 goto next_unicast;<br><br>=C2=A0=C2=A0 if ( address.GetType=
() =3D=3D ADDRESS_IPV6 && !address.IsGlobalUnicast() )<br>=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 goto next_unicast;<br><br>=C2=A0=C2=A0 addresses[numA=
ddresses++] =3D address;<br><br>=C2=A0=C2=A0 if ( numAddresses >=3D maxA=
ddresses )<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break;<br><br>next_unicast:<br=
><br>=C2=A0=C2=A0 pUnicast =3D pUnicast->Next;<br></div><div>}</div><div=
><br></div><div>A common=C2=A0response to the article was to immediately at=
tack the code and re-write it without using goto because people considered =
it sloppy. This got me thinking about a few things:</div><div><br></div><di=
v>#1 It reminded me=C2=A0how fearful people are=C2=A0of goto so that they w=
on't use it even if it's appropriate;=C2=A0and not only that, but t=
hey=C2=A0will also re-write=C2=A0other peoples code=C2=A0using goto=C2=A0to=
avoid it even if it isn't a big deal. The example loop above isn't=
that unreasonable=C2=A0especially if you imagine you might want to add add=
itional statements later at the goto target point. That then brings me to m=
y main point:</div><div><br></div><div>#2=C2=A0Sometimes I want to=C2=A0exe=
cute=C2=A0the same=C2=A0set of=C2=A0code on continuation and putting it all=
in the increment section of the loop isn't that nice or even realistic=
.. But using a goto isn't that nice either or having someone re-write=C2=
=A0code just because *they* don't like goto.</div><div><br></div><div>P=
roposal:</div><div>If we had a special continue block in the language, thes=
e problems wouldn't exist because=C2=A0we could re-write the above loop=
=C2=A0like=C2=A0so:=C2=A0</div><div><br></div><div>for ( int i =3D 0; pUnic=
ast !=3D NULL; i++ )<br>{<br>=C2=A0=C2=A0 Address address( (sockaddr_storag=
e*) pUnicast->Address.lpSockaddr );<br><br>=C2=A0=C2=A0 if ( !address.Is=
Valid() )<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 continue; // goto the continue =
block below<br><br>=C2=A0=C2=A0 if ( address.IsLoopback() )<br>=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 continue;<br><br>=C2=A0=C2=A0 if ( address.GetType() =3D=
=3D ADDRESS_IPV6 && !address.IsGlobalUnicast() )<br>=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 continue;<br><br>=C2=A0=C2=A0 addresses[numAddresses++] =3D=
address;<br><br>=C2=A0=C2=A0 if ( numAddresses >=3D maxAddresses )<br>=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break;<br><br>=C2=A0=C2=A0 continue</div><di=
v>=C2=A0=C2=A0 {</div><div>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // Whatever=
else you like here.<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pUnicast =3D p=
Unicast->Next</div><div>=C2=A0=C2=A0=C2=A0} // on normal exit goto the r=
egular continue point of the loop.<br></div><div>}</div><div><br></div><div=
>This seems=C2=A0useful to me and would solve the points mentioned above an=
d=C2=A0it could be added without introducing any new keywords.=C2=A0It woul=
d=C2=A0make=C2=A0goto=C2=A0even less useful and allow use=C2=A0in multiple =
loops=C2=A0without having to makeup=C2=A0random label names etc.=C2=A0</div=
><div><br></div><div>The continue block=C2=A0might be better=C2=A0outside o=
f=C2=A0the loop to avoid excessive indentation=C2=A0or at the start inside =
the loop for clarity.=C2=A0It=C2=A0might also need some re-jigging to get=
=C2=A0the syntax to play nicely with the "for else" type suggesti=
ons I've seen, so bare that in mind too when thinking about this. But y=
ou get the basic idea.</div><div><br></div><div>I'd appreciate peoples =
thoughts on the merit of the core=C2=A0idea first and then=C2=A0where they =
think the continuation block should go.</div><div><br></div><div><div><div>=
I expect=C2=A0this feature if adopted would=C2=A0to be available in while a=
nd do loops etc. too.</div></div></div><div><br></div><div>Thanks</div><div=
>GM<br></div></div></blockquote><div><br>I get the idea, but I really don&#=
39;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.<br><br>The a=
ctual 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 i=
teration statement. So... do that:<br><br><div class=3D"prettyprint" style=
=3D"background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187);=
border-style: solid; border-width: 1px; word-wrap: break-word;"><code clas=
s=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #008;=
" class=3D"styled-by-prettify">for</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">(</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">int=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> i </span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"c=
olor: #066;" class=3D"styled-by-prettify">0</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> pUnicast </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">!=3D</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> NULL</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">;</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"><br>=C2=A0 pUnicast </span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> pUnicast</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">-></span><span style=3D"color: #606;" class=3D"styled-by-prettify"=
>Next</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> i</span><span=
style=3D"color: #660;" class=3D"styled-by-prettify">++)</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0</span><span style=3D"colo=
r: #606;" class=3D"styled-by-prettify">Address</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> address</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">(</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify">sockaddr_storage</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">*)</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"> pUnicast</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">-></span><span style=3D"color: #606;" class=3D"styled-by-prettify">A=
ddress</span><span style=3D"color: #660;" class=3D"styled-by-prettify">.</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify">lpSockaddr </=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">);</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 =C2=
=A0</span><span style=3D"color: #008;" class=3D"styled-by-prettify">if</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">!</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">address</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">.</span><span style=3D"color: #606;" class=3D"styled-b=
y-prettify">IsValid</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">()</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">)</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0=
=C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-prettify">co=
ntinue</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span=
style=3D"color: #800;" class=3D"styled-by-prettify">// goto the continue b=
lock below</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
<br><br>=C2=A0 =C2=A0</span><span style=3D"color: #008;" class=3D"styled-by=
-prettify">if</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"> address</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">.</span><span sty=
le=3D"color: #606;" class=3D"styled-by-prettify">IsLoopback</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">()</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">)</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 </span><span style=3D"colo=
r: #008;" class=3D"styled-by-prettify">continue</span><span style=3D"color:=
#660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"><br><br>=C2=A0 =C2=A0</span><span style=3D"colo=
r: #008;" class=3D"styled-by-prettify">if</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> address</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">.</span><span style=3D"color: #606;" class=3D"styled-by-pretti=
fy">GetType</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>()</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D=3D</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> ADDRESS_IPV6 </span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">&&</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">!</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify">address</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">.</span><span style=3D"color: #606;" =
class=3D"styled-by-prettify">IsGlobalUnicast</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">()</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">)</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"><br>=C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">continue</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"><br><br>=C2=A0 =C2=A0addresses</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">[</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify">numAddresses</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">++]</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"> address</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><b=
r>=C2=A0 =C2=A0</span><span style=3D"color: #008;" class=3D"styled-by-prett=
ify">if</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> numAddresses </span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">>=3D</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> maxAddresses </span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">)</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =
</span><span style=3D"color: #008;" class=3D"styled-by-prettify">break</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">}</span></div></code></div><=
br>This puts all of the iteration logic in the same place: the `for` statem=
ent 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.<br></di=
v></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/28358863-5be0-401a-893a-0ae5385156c2%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/28358863-5be0-401a-893a-0ae5385156c2=
%40isocpp.org</a>.<br />
------=_Part_232_1905488901.1469459302808--
------=_Part_231_358107579.1469459302807--
.
Author: Viacheslav Usov <via.usov@gmail.com>
Date: Mon, 25 Jul 2016 18:19:22 +0200
Raw View
--001a113fb874b441950538782537
Content-Type: text/plain; charset=UTF-8
On Mon, Jul 25, 2016 at 5:08 PM, Nicol Bolas <jmckesson@gmail.com> wrote:
> 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.
Since one can already use the comma operator to have multiple expressions
in the iteration statement, you probably meant "multi-statement". In which
case it should support control structures, and things go crazy very quickly
from then on.
Cheers,
V.
--
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/CAA7YVg3qqA2nkq5aP7Qur%2BXjBU%2BPAwJBffpiZON9%2B44im_WuQA%40mail.gmail.com.
--001a113fb874b441950538782537
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On M=
on, Jul 25, 2016 at 5:08 PM, Nicol Bolas <span dir=3D"ltr"><<a href=3D"m=
ailto:jmckesson@gmail.com" target=3D"_blank">jmckesson@gmail.com</a>></s=
pan> wrote:<br><div><br></div><div>> The actual problem is that there ar=
e times when your iteration statement can't be a single expression. So =
what you want is to have a multi-expression iteration statement.</div><div>=
<br></div><div>Since one can already use the comma operator to have multipl=
e expressions in the iteration statement, you probably meant "multi-st=
atement". In which case it should support control structures, and thin=
gs go crazy very quickly from then on.</div><div><br></div><div>Cheers,<br>=
</div><div>V.</div></div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/CAA7YVg3qqA2nkq5aP7Qur%2BXjBU%2BPAwJB=
ffpiZON9%2B44im_WuQA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoote=
r">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAA7YVg3qqA=
2nkq5aP7Qur%2BXjBU%2BPAwJBffpiZON9%2B44im_WuQA%40mail.gmail.com</a>.<br />
--001a113fb874b441950538782537--
.
Author: Viacheslav Usov <via.usov@gmail.com>
Date: Mon, 25 Jul 2016 18:38:08 +0200
Raw View
--001a113fb874dbb6450538786851
Content-Type: text/plain; charset=UTF-8
On Mon, Jul 25, 2016 at 6:19 PM, Viacheslav Usov <via.usov@gmail.com> wrote:
> Since one can already use the comma operator to have multiple expressions
in the iteration statement, you probably meant "multi-statement". In which
case it should support control structures, and things go crazy very quickly
from then on.
And, in fact, this is something that one can already do in modern C++:
for (int i = 0; i < 5; [&]{ if (i == 0) i = 2; else ++i; }())
printf("%d\n", i);
I generally find the idiom [&]{ /* something */ }() very useful, to the
point that I'd like to have some less ugly syntax for it, for example [{ /*
something */ }].
Cheers,
V.
--
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/CAA7YVg3v%3D-_D-oR5uvXRjJHGWgvd6VmrPPH7O1cvWCgHJ9%2B_ZA%40mail.gmail.com.
--001a113fb874dbb6450538786851
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On M=
on, Jul 25, 2016 at 6:19 PM, Viacheslav Usov <span dir=3D"ltr"><<a href=
=3D"mailto:via.usov@gmail.com" target=3D"_blank">via.usov@gmail.com</a>>=
</span> wrote:<br><div><br></div><div>> Since one can already use the co=
mma operator to have multiple expressions in the iteration statement, you p=
robably meant "multi-statement". In which case it should support =
control structures, and things go crazy very quickly from then on.</div><di=
v><br></div><div>And, in fact, this is something that one can already do in=
modern C++:</div><div><br></div><div><div><span class=3D"" style=3D"white-=
space:pre"> </span>for (int i =3D 0; i < 5; [&]{ if (i =3D=3D 0) i =
=3D 2; else ++i; }())</div><div><span class=3D"" style=3D"white-space:pre">=
</span>printf("%d\n", i);</div></div><div><br></div><div>I gene=
rally find the idiom [&]{ /* something */ }() very useful, to the point=
that I'd like to have some less ugly syntax for it, for example [{ /* =
something */ }].</div><div><br></div><div>Cheers,</div><div>V.</div></div><=
/div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/CAA7YVg3v%3D-_D-oR5uvXRjJHGWgvd6VmrPP=
H7O1cvWCgHJ9%2B_ZA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAA7YVg3v%3D-=
_D-oR5uvXRjJHGWgvd6VmrPPH7O1cvWCgHJ9%2B_ZA%40mail.gmail.com</a>.<br />
--001a113fb874dbb6450538786851--
.
Author: gmisocpp@gmail.com
Date: Mon, 25 Jul 2016 14:12:12 -0700 (PDT)
Raw View
------=_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'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.<br></div></div></blockquote><div><br></div><div>I think you correc=
tly understand the problem statement, but I'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'=
;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);">-></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'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't like the existing f=
or loops syntax, so I'm not sure it'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);">-></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'm hearing you do=
n't like my proposed syntax.=C2=A0let's=C2=A0find a better one then=
.. You are currently holding onto the existing syntax and I don't find t=
hat superior to my suggestion for anything but the most trivial of situatio=
ns. I'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" 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--
.
Author: gmisocpp@gmail.com
Date: Mon, 25 Jul 2016 14:15:20 -0700 (PDT)
Raw View
------=_Part_1376_391879544.1469481320722
Content-Type: multipart/alternative;
boundary="----=_Part_1377_514497668.1469481320722"
------=_Part_1377_514497668.1469481320722
Content-Type: text/plain; charset=UTF-8
Hi V
Thanks for replying.
On Tuesday, July 26, 2016 at 4:38:11 AM UTC+12, Viacheslav Usov wrote:
> On Mon, Jul 25, 2016 at 6:19 PM, Viacheslav Usov <via....@gmail.com
> <javascript:>> wrote:
>
> > Since one can already use the comma operator to have multiple
> expressions in the iteration statement, you probably meant
> "multi-statement". In which case it should support control structures, and
> things go crazy very quickly from then on.
>
> And, in fact, this is something that one can already do in modern C++:
>
> for (int i = 0; i < 5; [&]{ if (i == 0) i = 2; else ++i; }())
> printf("%d\n", i);
>
> I generally find the idiom [&]{ /* something */ }() very useful, to the
> point that I'd like to have some less ugly syntax for it, for example [{ /*
> something */ }].
>
> Cheers,
> V.
>
I think we are in agreement that lambda's don't seem to be solve this
problem as cleanly as we'd like.
--
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/b251c6f8-c214-4281-a6f9-0689fcb7ef65%40isocpp.org.
------=_Part_1377_514497668.1469481320722
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Hi V</div><div><br></div><div>Thanks for replying.<br=
><br>On Tuesday, July 26, 2016 at 4:38:11 AM UTC+12, Viacheslav Usov wrote:=
</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><div class=3D"gmai=
l_quote">On Mon, Jul 25, 2016 at 6:19 PM, Viacheslav Usov <span dir=3D"ltr"=
><<a onmousedown=3D"this.href=3D'javascript:';return true;" oncl=
ick=3D"this.href=3D'javascript:';return true;" href=3D"javascript:"=
target=3D"_blank" rel=3D"nofollow" gdf-obfuscated-mailto=3D"Tig0ub-NBAAJ">=
via....@gmail.com</a>></span> wrote:<br><div><br></div><div>> Since o=
ne can already use the comma operator to have multiple expressions in the i=
teration statement, you probably meant "multi-statement". In whic=
h case it should support control structures, and things go crazy very quick=
ly from then on.</div><div><br></div><div>And, in fact, this is something t=
hat one can already do in modern C++:</div><div><br></div><div><div><span s=
tyle=3D"white-space: pre;"> </span>for (int i =3D 0; i < 5; [&]{ if =
(i =3D=3D 0) i =3D 2; else ++i; }())</div><div><span style=3D"white-space: =
pre;"> </span>printf("%d\n", i);</div></div><div><br></div><div>=
I generally find the idiom [&]{ /* something */ }() very useful, to the=
point that I'd like to have some less ugly syntax for it, for example =
[{ /* something */ }].</div><div><br></div><div>Cheers,</div><div>V.</div><=
/div></div></div></blockquote><div><br></div><div>I think we are in agreeme=
nt=C2=A0that=C2=A0lambda's don't seem to be=C2=A0solve=C2=A0this pr=
oblem as cleanly as we'd like.</div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/b251c6f8-c214-4281-a6f9-0689fcb7ef65%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/b251c6f8-c214-4281-a6f9-0689fcb7ef65=
%40isocpp.org</a>.<br />
------=_Part_1377_514497668.1469481320722--
------=_Part_1376_391879544.1469481320722--
.
Author: gmisocpp@gmail.com
Date: Mon, 25 Jul 2016 14:37:12 -0700 (PDT)
Raw View
------=_Part_5398_1940599692.1469482633076
Content-Type: multipart/alternative;
boundary="----=_Part_5399_311818761.1469482633076"
------=_Part_5399_311818761.1469482633076
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Monday, July 25, 2016 at 9:18:31 PM UTC+12, D. B. wrote:
>
> On Mon, Jul 25, 2016 at 9:51 AM, Jonathan M=C3=BCller <jonathanm...@gmail=
..com=20
> <javascript:>> wrote:
>
>> How is that a duplicate? That proposal wants different code executed on=
=20
>> the various *break* conditions, this on a *continue*. He even mentions t=
hat=20
>> proposal(s).
>>
> It seems like a direct extension of the same idea, and lorro mentioned=20
> continue in that proposal while discussing how it's quite open-ended in=
=20
> terms of all the 'catch blocks' it could potentially handle. But ymmv.
>
>
That thread seemed more focused on the break aspect and I'm more focused on=
=20
continue side so I'm obviously reading it the same way as the Jonathan did.=
=20
You can talk about either in either thread if you want, if you're saying=20
something useful. But I'd suggest talking break there and continue here,=20
especially as I think the problems being addressed warrant their own=20
threads in any case (not that I care strongly). I mainly raised the other=
=20
thread to alert people that we want to avoid a syntax for either=20
problem that blocks the other. I'm interested in what you actually think of=
=20
the problems at hand wherever you want to discuss it?
--=20
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 e=
mail 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/463de12d-f1f8-418a-a300-c39b8a861fcd%40isocpp.or=
g.
------=_Part_5399_311818761.1469482633076
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Monday, July 25, 2016 at 9:18:31 PM UTC+12, D. =
B. wrote:<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 dir=3D"ltr"><div><div class=3D"g=
mail_quote">On Mon, Jul 25, 2016 at 9:51 AM, Jonathan M=C3=BCller <span dir=
=3D"ltr"><<a onmousedown=3D"this.href=3D'javascript:';return tru=
e;" onclick=3D"this.href=3D'javascript:';return true;" href=3D"java=
script:" target=3D"_blank" rel=3D"nofollow" gdf-obfuscated-mailto=3D"H4PNqM=
F1BAAJ">jonathanm...@gmail.com</a><wbr>></span> wrote:<br><blockquote cl=
ass=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;"><p dir=3D"ltr">How is that a duplicate? That proposal wants =
different code executed on the various *break* conditions, this on a *conti=
nue*. He even mentions that proposal(s).</p></blockquote><div>It seems=C2=
=A0like a direct=C2=A0extension of the same idea, and=C2=A0lorro mentioned =
continue in that proposal while discussing how it's quite open-ended in=
terms of all the 'catch blocks' it could potentially handle. But y=
mmv.</div><div><br></div></div></div></div></blockquote><div><br></div><div=
>That thread=C2=A0seemed more=C2=A0focused on the break aspect=C2=A0and I&#=
39;m more focused on continue=C2=A0side so I'm obviously reading it the=
same way as the Jonathan did. You can talk about either in either thread i=
f you want, if you're saying something useful.=C2=A0But I'd suggest=
talking break there and continue here, especially as=C2=A0I think the prob=
lems being addressed warrant their own threads in any case (not that I care=
strongly).=C2=A0I mainly raised the other thread=C2=A0to alert people=C2=
=A0that we want to=C2=A0avoid=C2=A0a syntax=C2=A0for either problem=C2=A0th=
at blocks the=C2=A0other. I'm interested in what you actually think of =
the problems at hand wherever you want to discuss it?</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" 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/463de12d-f1f8-418a-a300-c39b8a861fcd%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/463de12d-f1f8-418a-a300-c39b8a861fcd=
%40isocpp.org</a>.<br />
------=_Part_5399_311818761.1469482633076--
------=_Part_5398_1940599692.1469482633076--
.
Author: Sean Middleditch <sean.middleditch@gmail.com>
Date: Mon, 25 Jul 2016 17:01:37 -0700 (PDT)
Raw View
------=_Part_1277_712424841.1469491298070
Content-Type: multipart/alternative;
boundary="----=_Part_1278_2027970891.1469491298078"
------=_Part_1278_2027970891.1469491298078
Content-Type: text/plain; charset=UTF-8
Or just remove the variable i from the loop entirely because it's unused in
the loop body, thus reducing the for statement to:
for(; pUnicast != nullptr; pUnicat = pUnicast->Next)
Not that a multi-statement increment wouldn't be useful, but this code
snippet is a pretty terrible motivating example. Sorry Glenn! :)
Anecdotally though (not that anyone cares, nor should you), I can't recall
a time I ever felt that I needed multiple loop incrementees without
eventually realizing that I was just writing my loop like an idiot. Or
missing an easily-written library facility to use with for-range iterator.
:)
On Monday, July 25, 2016 at 8:08:23 AM UTC-7, Nicol Bolas wrote:
>
>
> for ( int i = 0; pUnicast != NULL;
> pUnicast = pUnicast->Next; i++)
> {
> Address address( (sockaddr_storage*) pUnicast->Address.lpSockaddr );
>
> if ( !address.IsValid() )
> continue; // goto the continue block below
>
> if ( address.IsLoopback() )
> continue;
>
> if ( address.GetType() == ADDRESS_IPV6 && !address.IsGlobalUnicast() )
> continue;
>
> addresses[numAddresses++] = address;
>
> if ( numAddresses >= maxAddresses )
> break;
> }
>
> 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.
>
--
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/8ee79066-43c5-4624-8fb5-01172eb36d29%40isocpp.org.
------=_Part_1278_2027970891.1469491298078
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Or just remove the variable i from the loop entirely becau=
se it's unused in the loop body, thus reducing the for statement to:<di=
v><br></div><div>=C2=A0 =C2=A0 for(; pUnicast !=3D nullptr; pUnicat =3D pUn=
icast->Next)<div><br></div><div><div>Not that a multi-statement incremen=
t wouldn't be useful, but this code snippet is a pretty terrible motiva=
ting example. Sorry Glenn! :)</div><div><br></div><div>Anecdotally though (=
not that anyone cares, nor should you), I can't recall a time I ever fe=
lt that I needed multiple loop incrementees without eventually realizing th=
at I was just writing my loop like an idiot. Or missing an easily-written l=
ibrary facility to use with for-range iterator. :)</div><div><div><br>On Mo=
nday, July 25, 2016 at 8:08:23 AM UTC-7, Nicol Bolas wrote:<blockquote clas=
s=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #c=
cc solid;padding-left: 1ex;"><div dir=3D"ltr"><div><br><div style=3D"backgr=
ound-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:soli=
d;border-width:1px;word-wrap:break-word"><code><div><span style=3D"color:#0=
08">for</span><span style=3D"color:#000"> </span><span style=3D"color:#660"=
>(</span><span style=3D"color:#000"> </span><span style=3D"color:#008">int<=
/span><span style=3D"color:#000"> i </span><span style=3D"color:#660">=3D</=
span><span style=3D"color:#000"> </span><span style=3D"color:#066">0</span>=
<span style=3D"color:#660">;</span><span style=3D"color:#000"> pUnicast </s=
pan><span style=3D"color:#660">!=3D</span><span style=3D"color:#000"> NULL<=
/span><span style=3D"color:#660">;</span><span style=3D"color:#000"><br>=C2=
=A0 pUnicast </span><span style=3D"color:#660">=3D</span><span style=3D"col=
or:#000"> pUnicast</span><span style=3D"color:#660">-></span><span style=
=3D"color:#606">Next</span><span style=3D"color:#660">;</span><span style=
=3D"color:#000"> i</span><span style=3D"color:#660">++)</span><span style=
=3D"color:#000"><br></span><span style=3D"color:#660">{</span><span style=
=3D"color:#000"><br>=C2=A0 =C2=A0</span><span style=3D"color:#606">Address<=
/span><span style=3D"color:#000"> address</span><span style=3D"color:#660">=
(</span><span style=3D"color:#000"> </span><span style=3D"color:#660">(</sp=
an><span style=3D"color:#000">sockaddr_storage</span><span style=3D"color:#=
660">*)</span><span style=3D"color:#000"> pUnicast</span><span style=3D"col=
or:#660">-></span><span style=3D"color:#606">Address</span><span style=
=3D"color:#660">.</span><span style=3D"color:#000">lpSockaddr </span><span =
style=3D"color:#660">);</span><span style=3D"color:#000"><br><br>=C2=A0 =C2=
=A0</span><span style=3D"color:#008">if</span><span style=3D"color:#000"> <=
/span><span style=3D"color:#660">(</span><span style=3D"color:#000"> </span=
><span style=3D"color:#660">!</span><span style=3D"color:#000">address</spa=
n><span style=3D"color:#660">.</span><span style=3D"color:#606">IsValid</sp=
an><span style=3D"color:#660">()</span><span style=3D"color:#000"> </span><=
span style=3D"color:#660">)</span><span style=3D"color:#000"><br>=C2=A0 =C2=
=A0 =C2=A0 </span><span style=3D"color:#008">continue</span><span style=3D"=
color:#660">;</span><span style=3D"color:#000"> </span><span style=3D"color=
:#800">// goto the continue block below</span><span style=3D"color:#000"><b=
r><br>=C2=A0 =C2=A0</span><span style=3D"color:#008">if</span><span style=
=3D"color:#000"> </span><span style=3D"color:#660">(</span><span style=3D"c=
olor:#000"> address</span><span style=3D"color:#660">.</span><span style=3D=
"color:#606">IsLoopback</span><span style=3D"color:#660">()</span><span sty=
le=3D"color:#000"> </span><span style=3D"color:#660">)</span><span style=3D=
"color:#000"><br>=C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color:#008">con=
tinue</span><span style=3D"color:#660">;</span><span style=3D"color:#000"><=
br><br>=C2=A0 =C2=A0</span><span style=3D"color:#008">if</span><span style=
=3D"color:#000"> </span><span style=3D"color:#660">(</span><span style=3D"c=
olor:#000"> address</span><span style=3D"color:#660">.</span><span style=3D=
"color:#606">GetType</span><span style=3D"color:#660">()</span><span style=
=3D"color:#000"> </span><span style=3D"color:#660">=3D=3D</span><span style=
=3D"color:#000"> ADDRESS_IPV6 </span><span style=3D"color:#660">&&<=
/span><span style=3D"color:#000"> </span><span style=3D"color:#660">!</span=
><span style=3D"color:#000">address</span><span style=3D"color:#660">.</spa=
n><span style=3D"color:#606">IsGlobalUnicast</span><span style=3D"color:#66=
0">()</span><span style=3D"color:#000"> </span><span style=3D"color:#660">)=
</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0 =C2=A0 </span><span sty=
le=3D"color:#008">continue</span><span style=3D"color:#660">;</span><span s=
tyle=3D"color:#000"><br><br>=C2=A0 =C2=A0addresses</span><span style=3D"col=
or:#660">[</span><span style=3D"color:#000">numAddresses</span><span style=
=3D"color:#660">++]</span><span style=3D"color:#000"> </span><span style=3D=
"color:#660">=3D</span><span style=3D"color:#000"> address</span><span styl=
e=3D"color:#660">;</span><span style=3D"color:#000"><br><br>=C2=A0 =C2=A0</=
span><span style=3D"color:#008">if</span><span style=3D"color:#000"> </span=
><span style=3D"color:#660">(</span><span style=3D"color:#000"> numAddresse=
s </span><span style=3D"color:#660">>=3D</span><span style=3D"color:#000=
"> maxAddresses </span><span style=3D"color:#660">)</span><span style=3D"co=
lor:#000"><br>=C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color:#008">break<=
/span><span style=3D"color:#660">;</span><span style=3D"color:#000"><br></s=
pan><span style=3D"color:#660">}</span></div></code></div><br>This puts all=
of the iteration logic in the same place: the `for` statement itself. So i=
f 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.<br></div></div></blockq=
uote></div></div></div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/8ee79066-43c5-4624-8fb5-01172eb36d29%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/8ee79066-43c5-4624-8fb5-01172eb36d29=
%40isocpp.org</a>.<br />
------=_Part_1278_2027970891.1469491298078--
------=_Part_1277_712424841.1469491298070--
.
Author: gmisocpp@gmail.com
Date: Mon, 25 Jul 2016 17:57:38 -0700 (PDT)
Raw View
------=_Part_1671_2115848116.1469494659019
Content-Type: multipart/alternative;
boundary="----=_Part_1672_1187900692.1469494659019"
------=_Part_1672_1187900692.1469494659019
Content-Type: text/plain; charset=UTF-8
On Tuesday, July 26, 2016 at 12:01:38 PM UTC+12, Sean Middleditch wrote:
>
> Or just remove the variable i from the loop entirely because it's unused
> in the loop body, thus reducing the for statement to:
>
> for(; pUnicast != nullptr; pUnicat = pUnicast->Next)
>
> Not that a multi-statement increment wouldn't be useful, but this code
> snippet is a pretty terrible motivating example. Sorry Glenn! :)
>
It's just some code I saw on reddit. But c'mon, you're being as
unimaginative here as I've been lazy in crimping some random code to
demonstrate the use case! lol
I'm not suggesting the need is desperate, but I have myself a few times in
the past written loops where I've realised that I'd like to "continue
early" a few times - much like returning early - to avoid complicating
later code with logic just to avoid it being hit. But I'd still like to do
something a bit more significant on each continue occasionally and not want
to repeat that code or to have to try to shoe horn that logic into the
increment statement of the loop or use a comma there where it just feels
wrong and is too constrained.
I don't think you need to be that imaginative to see that ;) but hey I'm
sure you won't be alone in your opinion if you still don't agree. I perhaps
should contact the author of the original code and see if they agree if
this facility would encourage them to use it over goto. That would a be a
little interesting to me.
Thanks for your feedback.
>
> Anecdotally though (not that anyone cares, nor should you), I can't recall
> a time I ever felt that I needed multiple loop incrementees without
> eventually realizing that I was just writing my loop like an idiot. Or
> missing an easily-written library facility to use with for-range iterator.
> :)
>
> On Monday, July 25, 2016 at 8:08:23 AM UTC-7, Nicol Bolas wrote:
>>
>>
>> for ( int i = 0; pUnicast != NULL;
>> pUnicast = pUnicast->Next; i++)
>> {
>> Address address( (sockaddr_storage*) pUnicast->Address.lpSockaddr );
>>
>> if ( !address.IsValid() )
>> continue; // goto the continue block below
>>
>> if ( address.IsLoopback() )
>> continue;
>>
>> if ( address.GetType() == ADDRESS_IPV6 && !address.IsGlobalUnicast() )
>> continue;
>>
>> addresses[numAddresses++] = address;
>>
>> if ( numAddresses >= maxAddresses )
>> break;
>> }
>>
>> 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.
>>
>
--
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/c0a2a265-9128-490c-b80e-d9f7438df92a%40isocpp.org.
------=_Part_1672_1187900692.1469494659019
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Tuesday, July 26, 2016 at 12:01:38 PM UTC+12, S=
ean Middleditch wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0p=
x 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">Or just=
remove the variable i from the loop entirely because it's unused in th=
e loop body, thus reducing the for statement to:<div><br></div><div>=C2=A0 =
=C2=A0 for(; pUnicast !=3D nullptr; pUnicat =3D pUnicast->Next)<div><br>=
</div><div><div>Not that a multi-statement increment wouldn't be useful=
, but this code snippet is a pretty terrible motivating example. Sorry Glen=
n! :)</div></div></div></div></blockquote><div><br></div><div>It's just=
some code I saw on reddit. But c'mon, you're being as unimaginativ=
e here as I've been lazy in crimping some random code to demonstrate=C2=
=A0the=C2=A0use case! lol</div><div>I'm not suggesting the need=C2=A0is=
desperate, but I have myself a few times in the past written loops where I=
've realised that I'd like to "continue early" a few time=
s - much like returning early - to avoid complicating later code=C2=A0with =
logic=C2=A0just to avoid it being hit. But I'd still like to do somethi=
ng a bit more significant on each continue occasionally and not want to rep=
eat that code or=C2=A0to have to try to=C2=A0shoe horn that logic into the =
increment statement of the loop or use=C2=A0a comma there where it=C2=A0jus=
t feels wrong and is too constrained.</div><div><br></div><div>I don't =
think you need to be=C2=A0that imaginative to see that ;)=C2=A0but hey I=
9;m sure you won't be alone in your opinion if you still don't agre=
e. I perhaps should contact the author of the original code and see if they=
agree if this facility would encourage them to use it over goto. That woul=
d a be a little interesting to me.</div><div><br></div><div>Thanks for your=
feedback.</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-c=
olor: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;=
"><div dir=3D"ltr"><div><div><div><br></div><div>Anecdotally though (not th=
at anyone cares, nor should you), I can't recall a time I ever felt tha=
t I needed multiple loop incrementees without eventually realizing that I w=
as just writing my loop like an idiot. Or missing an easily-written library=
facility to use with for-range iterator. :)</div><div><div><br>On Monday, =
July 25, 2016 at 8:08:23 AM UTC-7, Nicol Bolas wrote:<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"><div><br><div style=3D"border: 1px solid rgb(187, 1=
87, 187); border-image: none; -ms-word-wrap: break-word; background-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 style=3D"color: rg=
b(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 st=
yle=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(102, 102, =
0);">!=3D</span><span style=3D"color: rgb(0, 0, 0);"> NULL</span><span styl=
e=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</s=
pan><span style=3D"color: rgb(0, 0, 0);"> pUnicast</span><span style=3D"col=
or: rgb(102, 102, 0);">-></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><span style=3D"color: rgb(0, 0, 0);"><br></span><span style=3D"colo=
r: rgb(102, 102, 0);">{</span><span style=3D"color: rgb(0, 0, 0);"><br>=C2=
=A0 =C2=A0</span><span style=3D"color: rgb(102, 0, 102);">Address</span><sp=
an style=3D"color: rgb(0, 0, 0);"> address</span><span style=3D"color: rgb(=
102, 102, 0);">(</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=
);">sockaddr_storage</span><span style=3D"color: rgb(102, 102, 0);">*)</spa=
n><span style=3D"color: rgb(0, 0, 0);"> pUnicast</span><span style=3D"color=
: rgb(102, 102, 0);">-></span><span style=3D"color: rgb(102, 0, 102);">A=
ddress</span><span style=3D"color: rgb(102, 102, 0);">.</span><span style=
=3D"color: rgb(0, 0, 0);">lpSockaddr </span><span style=3D"color: rgb(102, =
102, 0);">);</span><span style=3D"color: rgb(0, 0, 0);"><br><br>=C2=A0 =C2=
=A0</span><span style=3D"color: rgb(0, 0, 136);">if</span><span style=3D"co=
lor: rgb(0, 0, 0);"> </span><span style=3D"color: rgb(102, 102, 0);">(</spa=
n><span style=3D"color: rgb(0, 0, 0);"> </span><span style=3D"color: rgb(10=
2, 102, 0);">!</span><span style=3D"color: rgb(0, 0, 0);">address</span><sp=
an style=3D"color: rgb(102, 102, 0);">.</span><span style=3D"color: rgb(102=
, 0, 102);">IsValid</span><span style=3D"color: rgb(102, 102, 0);">()</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);"><br>=C2=A0 =C2=A0 =
=C2=A0 </span><span style=3D"color: rgb(0, 0, 136);">continue</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(136, 0, 0);">// goto the continue blo=
ck below</span><span style=3D"color: rgb(0, 0, 0);"><br><br>=C2=A0 =C2=A0</=
span><span style=3D"color: rgb(0, 0, 136);">if</span><span style=3D"color: =
rgb(0, 0, 0);"> </span><span style=3D"color: rgb(102, 102, 0);">(</span><sp=
an style=3D"color: rgb(0, 0, 0);"> address</span><span style=3D"color: rgb(=
102, 102, 0);">.</span><span style=3D"color: rgb(102, 0, 102);">IsLoopback<=
/span><span style=3D"color: rgb(102, 102, 0);">()</span><span style=3D"colo=
r: rgb(0, 0, 0);"> </span><span style=3D"color: rgb(102, 102, 0);">)</span>=
<span style=3D"color: rgb(0, 0, 0);"><br>=C2=A0 =C2=A0 =C2=A0 </span><span =
style=3D"color: rgb(0, 0, 136);">continue</span><span style=3D"color: rgb(1=
02, 102, 0);">;</span><span style=3D"color: rgb(0, 0, 0);"><br><br>=C2=A0 =
=C2=A0</span><span style=3D"color: rgb(0, 0, 136);">if</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);"> address</span><span style=3D"col=
or: rgb(102, 102, 0);">.</span><span style=3D"color: rgb(102, 0, 102);">Get=
Type</span><span style=3D"color: rgb(102, 102, 0);">()</span><span style=3D=
"color: rgb(0, 0, 0);"> </span><span style=3D"color: rgb(102, 102, 0);">=3D=
=3D</span><span style=3D"color: rgb(0, 0, 0);"> ADDRESS_IPV6 </span><span s=
tyle=3D"color: rgb(102, 102, 0);">&&</span><span style=3D"color: rg=
b(0, 0, 0);"> </span><span style=3D"color: rgb(102, 102, 0);">!</span><span=
style=3D"color: rgb(0, 0, 0);">address</span><span style=3D"color: rgb(102=
, 102, 0);">.</span><span style=3D"color: rgb(102, 0, 102);">IsGlobalUnicas=
t</span><span style=3D"color: rgb(102, 102, 0);">()</span><span style=3D"co=
lor: rgb(0, 0, 0);"> </span><span style=3D"color: rgb(102, 102, 0);">)</spa=
n><span style=3D"color: rgb(0, 0, 0);"><br>=C2=A0 =C2=A0 =C2=A0 </span><spa=
n style=3D"color: rgb(0, 0, 136);">continue</span><span style=3D"color: rgb=
(102, 102, 0);">;</span><span style=3D"color: rgb(0, 0, 0);"><br><br>=C2=A0=
=C2=A0addresses</span><span style=3D"color: rgb(102, 102, 0);">[</span><sp=
an style=3D"color: rgb(0, 0, 0);">numAddresses</span><span style=3D"color: =
rgb(102, 102, 0);">++]</span><span style=3D"color: rgb(0, 0, 0);"> </span><=
span style=3D"color: rgb(102, 102, 0);">=3D</span><span style=3D"color: rgb=
(0, 0, 0);"> address</span><span style=3D"color: rgb(102, 102, 0);">;</span=
><span style=3D"color: rgb(0, 0, 0);"><br><br>=C2=A0 =C2=A0</span><span sty=
le=3D"color: rgb(0, 0, 136);">if</span><span style=3D"color: rgb(0, 0, 0);"=
> </span><span style=3D"color: rgb(102, 102, 0);">(</span><span style=3D"co=
lor: rgb(0, 0, 0);"> numAddresses </span><span style=3D"color: rgb(102, 102=
, 0);">>=3D</span><span style=3D"color: rgb(0, 0, 0);"> maxAddresses </s=
pan><span style=3D"color: rgb(102, 102, 0);">)</span><span style=3D"color: =
rgb(0, 0, 0);"><br>=C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: rgb(0,=
0, 136);">break</span><span style=3D"color: rgb(102, 102, 0);">;</span><sp=
an style=3D"color: rgb(0, 0, 0);"><br></span><span style=3D"color: rgb(102,=
102, 0);">}</span></div></code></div><br>This puts all of the iteration lo=
gic in the same place: the `for` statement itself. So if you want to see wh=
at happens on each loop, you don't have to look at both the top and the=
bottom of the `for` statement.<br></div></div></blockquote></div></div></d=
iv></div></div></blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/c0a2a265-9128-490c-b80e-d9f7438df92a%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/c0a2a265-9128-490c-b80e-d9f7438df92a=
%40isocpp.org</a>.<br />
------=_Part_1672_1187900692.1469494659019--
------=_Part_1671_2115848116.1469494659019--
.
Author: Miro Knejp <miro.knejp@gmail.com>
Date: Tue, 26 Jul 2016 03:13:45 +0200
Raw View
This is a multi-part message in MIME format.
--------------66F14B863DA4449F477AA76B
Content-Type: text/plain; charset=UTF-8; format=flowed
Am 26.07.2016 um 02:57 schrieb gmisocpp@gmail.com:
>
>
> On Tuesday, July 26, 2016 at 12:01:38 PM UTC+12, Sean Middleditch wrote:
>
> Or just remove the variable i from the loop entirely because it's
> unused in the loop body, thus reducing the for statement to:
>
> for(; pUnicast != nullptr; pUnicat = pUnicast->Next)
>
> Not that a multi-statement increment wouldn't be useful, but this
> code snippet is a pretty terrible motivating example. Sorry Glenn! :)
>
>
> It's just some code I saw on reddit. But c'mon, you're being as
> unimaginative here as I've been lazy in crimping some random code to
> demonstrate the use case! lol
> I'm not suggesting the need is desperate, but I have myself a few
> times in the past written loops where I've realised that I'd like to
> "continue early" a few times - much like returning early - to avoid
> complicating later code with logic just to avoid it being hit. But I'd
> still like to do something a bit more significant on each continue
> occasionally and not want to repeat that code or to have to try
> to shoe horn that logic into the increment statement of the loop or
> use a comma there where it just feels wrong and is too constrained.
>
> I don't think you need to be that imaginative to see that ;) but hey
> I'm sure you won't be alone in your opinion if you still don't agree.
> I perhaps should contact the author of the original code and see if
> they agree if this facility would encourage them to use it over goto.
> That would a be a little interesting to me.
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.
--
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/faae92a3-7756-bc06-20cd-69526d3160fe%40gmail.com.
--------------66F14B863DA4449F477AA76B
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
">
</head>
<body bgcolor=3D"#FFFFFF" text=3D"#000000">
Am 26.07.2016 um 02:57 schrieb <a class=3D"moz-txt-link-abbreviated" hr=
ef=3D"mailto:gmisocpp@gmail.com">gmisocpp@gmail.com</a>:<br>
<blockquote
cite=3D"mid:c0a2a265-9128-490c-b80e-d9f7438df92a@isocpp.org"
type=3D"cite">
<div dir=3D"ltr"><br>
<br>
On Tuesday, July 26, 2016 at 12:01:38 PM UTC+12, Sean
Middleditch wrote:
<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">Or just remove the variable i from the loop
entirely because it's unused in the loop body, thus reducing
the for statement to:
<div><br>
</div>
<div>=C2=A0 =C2=A0 for(; pUnicast !=3D nullptr; pUnicat =3D
pUnicast->Next)
<div><br>
</div>
<div>
<div>Not that a multi-statement increment wouldn't be
useful, but this code snippet is a pretty terrible
motivating example. Sorry Glenn! :)</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>It's just some code I saw on reddit. But c'mon, you're
being as unimaginative here as I've been lazy in crimping some
random code to demonstrate=C2=A0the=C2=A0use case! lol</div>
<div>I'm not suggesting the need=C2=A0is desperate, but I have myse=
lf
a few times in the past written loops where I've realised that
I'd like to "continue early" a few times - much like returning
early - to avoid complicating later code=C2=A0with logic=C2=A0jus=
t to
avoid it being hit. But I'd still like to do something a bit
more significant on each continue occasionally and not want to
repeat that code or=C2=A0to have to try to=C2=A0shoe horn that lo=
gic
into the increment statement of the loop or use=C2=A0a comma ther=
e
where it=C2=A0just feels wrong and is too constrained.</div>
<div><br>
</div>
<div>I don't think you need to be=C2=A0that imaginative to see that
;)=C2=A0but hey I'm sure you won't be alone in your opinion if yo=
u
still don't agree. I perhaps should contact the author of the
original code and see if they agree if this facility would
encourage them to use it over goto. That would a be a little
interesting to me.</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. "... 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.<br>
<br>
</body>
</html>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/faae92a3-7756-bc06-20cd-69526d3160fe%=
40gmail.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/faae92a3-7756-bc06-20cd-69526d3160fe%=
40gmail.com</a>.<br />
--------------66F14B863DA4449F477AA76B--
.
Author: gmisocpp@gmail.com
Date: Mon, 25 Jul 2016 18:52:50 -0700 (PDT)
Raw View
------=_Part_114_1753012605.1469497971063
Content-Type: multipart/alternative;
boundary="----=_Part_115_677769631.1469497971063"
------=_Part_115_677769631.1469497971063
Content-Type: text/plain; charset=UTF-8
>
>
> 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.
--
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/be336fa1-7a36-4a47-903e-25246fa254be%40isocpp.org.
------=_Part_115_677769631.1469497971063
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<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); borde=
r-left-width: 1px; border-left-style: solid;"><div text=3D"#000000" bgcolor=
=3D"#FFFFFF"><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. "... I have myself i=
n
the past written loops where ..." doesn'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'm =
sure they can imagine a=C2=A0motivating case already. If not,=C2=A0they are=
simply in the set of people who don't find this issue motivating, so t=
hey=C2=A0never will be. Let's be realistic. I'm ok with that. And i=
n any case I'm not going to create an implementation or do any other th=
ings that people might have on there wish list, I'm just throwing the i=
dea out there and if that motivates an expert to run with the idea great, i=
f not, that's ok too as=C2=A0I'm sure there time is more valuable t=
han mine. But I don't buy that imagination here is the problem. So you&=
#39;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.</div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/be336fa1-7a36-4a47-903e-25246fa254be%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/be336fa1-7a36-4a47-903e-25246fa254be=
%40isocpp.org</a>.<br />
------=_Part_115_677769631.1469497971063--
------=_Part_114_1753012605.1469497971063--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Mon, 25 Jul 2016 19:47:07 -0700 (PDT)
Raw View
------=_Part_3725_1719704416.1469501227969
Content-Type: multipart/alternative;
boundary="----=_Part_3726_1771998226.1469501227969"
------=_Part_3726_1771998226.1469501227969
Content-Type: text/plain; charset=UTF-8
On Monday, July 25, 2016 at 5:12:12 PM UTC-4, gmis...@gmail.com wrote:
>
> 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 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.
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.
`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.
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...
--
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/3326b130-cb6a-4c10-a804-6e236f12ec9e%40isocpp.org.
------=_Part_3726_1771998226.1469501227969
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Monday, July 25, 2016 at 5:12:12 PM UTC-4, gmis...@gmai=
l.com wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-lef=
t: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><=
div>Hi Nicol</div><div><br></div><div>Thanks for your comments.<br><br>On T=
uesday, July 26, 2016 at 3:08:23 AM UTC+12, Nicol Bolas wrote:</div><blockq=
uote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;padding-left:1=
ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-sty=
le:solid"><div dir=3D"ltr"><div>I
get the idea, but I really don't like the syntax for it. Especially=20
since it's based on a symptom (ie: how you would write it with goto)=20
rather than the problem.<br></div></div></blockquote><div><br></div><div>I
think you correctly understand the problem statement, but I'm less=20
sure=C2=A0from you're wording that you appreciated=C2=A0what I=20
actually=C2=A0proposed=C2=A0and 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 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>The
actual problem is that there are times when your iteration statement=20
can't be a single expression. So what you want is to have a=20
multi-expression iteration statement. So... do that:<br><br><div style=3D"b=
order:1px solid rgb(187,187,187);background-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 style=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><spa=
n 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:rg=
b(0,102,102)">0</span><span style=3D"color:rgb(102,102,0)">;</span><span st=
yle=3D"color:rgb(0,0,0)"> pUnicast </span><span style=3D"color:rgb(102,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 p=
Unicast </span><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)">=
-></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><sp=
an 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=20
itself. So if you want to see what happens on each loop, you don't have=
=20
to look at both the top and the bottom of the `for` statement.</div><div><b=
r></div><div>Yes
that is the problem,=C2=A0but I don't like the existing for loops synt=
ax, so
I'm not sure it's meaningful to propose that back to me, especiall=
y=20
when my proposal also catered for the logic being at the top of the=20
loop. See:</div></div></blockquote><blockquote class=3D"gmail_quote" style=
=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: =
1ex;"><div dir=3D"ltr"><div><br></div><div><div style=3D"border:1px solid r=
gb(187,187,187);background-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 style=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"colo=
r:rgb(0,0,0)"> i </span><span style=3D"color:rgb(102,102,0)">=3D</span><spa=
n 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:rg=
b(0,0,0)"> pUnicast </span><span style=3D"color:rgb(102,102,0)">!=3D</span>=
<span style=3D"color:rgb(0,0,0)"> NULL; </span><span style=3D"color:rgb(102=
,102,0)">)</span></div></code></div></div><div>{</div><div>=C2=A0=C2=A0cont=
inue {</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)"> pUnic=
ast</span><span style=3D"color:rgb(102,102,0)">-></span><span style=3D"c=
olor: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)">// whateve=
r</span></div><div><span style=3D"color:rgb(102,0,102)">}</span></div></div=
></blockquote><div><br>I fail to see how that is in any way better syntax t=
han what I suggested. Indeed, it's worse because it gives the writer th=
e choice of where this "continue" block is.<br><br>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.<br><br></div><blockquote class=3D"g=
mail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc sol=
id;padding-left: 1ex;"><div dir=3D"ltr"><p><span style=3D"color:rgb(102,0,1=
02)"></span></p>I'm
hearing you don't like my proposed syntax.=C2=A0let's=C2=A0find a =
better one=20
then. You are currently holding onto the existing syntax and I don't=20
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=
=20
trivial situations.<br></div></blockquote><div><br>What is a "non-triv=
ial situation"? That's kinds the problem with your idea: this use =
case simply doesn't happen *that* often.<br><br>`for` is nothing more t=
han 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.<br><b=
r>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 multip=
le counter <i>statements</i> (not just expressions but actual statements) i=
s quite low.<br><br>In those cases, `goto` is the proper tool. That's w=
hy we keep it around, after all. Not because it's useful most of the ti=
me. 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 c=
annot cleanly handle. We take the tool off the shelf and use it to get thin=
gs done in a reasonable way.<br><br>We should not add syntax for exceptiona=
lly 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` l=
oop, thus <i>forcing</i> the coding style. By doing so, we make it abundant=
ly clear that the loop's logic doesn't follow the standard `for` ru=
les. `for` exists for trivial circumstances; if your circumstances are non=
-trivial, then it's simply the wrong tool.<br></div><br>On Monday, July=
25, 2016 at 9:52:51 PM UTC-4, gmis...@gmail.com wrote:<blockquote class=3D=
"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc s=
olid;padding-left: 1ex;"><div dir=3D"ltr"><blockquote class=3D"gmail_quote"=
style=3D"margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(2=
04,204,204);border-left-width:1px;border-left-style:solid"><div text=3D"#00=
0000" bgcolor=3D"#FFFFFF"><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. "... I have myself i=
n
the past written loops where ..." doesn'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'm =
sure they can imagine a=C2=A0motivating case already. If not,=C2=A0they are=
simply in the set of people who don't find this issue motivating, so t=
hey=C2=A0never will be. Let's be realistic. I'm ok with that. And i=
n any case I'm not going to create an implementation or do any other th=
ings that people might have on there wish list, I'm just throwing the i=
dea out there and if that motivates an expert to run with the idea great, i=
f not, that's ok too as=C2=A0I'm sure there time is more valuable t=
han mine. But I don't buy that imagination here is the problem. So you&=
#39;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.</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's no point in giving =
it to them. I can't say that I find such an "argument" convin=
cing...<br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/3326b130-cb6a-4c10-a804-6e236f12ec9e%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/3326b130-cb6a-4c10-a804-6e236f12ec9e=
%40isocpp.org</a>.<br />
------=_Part_3726_1771998226.1469501227969--
------=_Part_3725_1719704416.1469501227969--
.
Author: gmisocpp@gmail.com
Date: Mon, 25 Jul 2016 20:26:54 -0700 (PDT)
Raw View
------=_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's worse because it gives the writer the choice of =
where this "continue" block is.<br><br>A reader of a `for` loop s=
hould not have to scan through the loop's body just to find out how it =
iterates through its stuff.<br></div></div></blockquote><div><br></div><div=
>Why don'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 "have to" 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'd like people=
to=C2=A0vote for=C2=A0where 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 "scann=
ing" 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'm
hearing you don't like my proposed syntax.=C2=A0let's=C2=A0find a =
better one=20
then. You are currently holding onto the existing syntax and I don't=20
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=
=20
trivial situations.<br></div></blockquote><div><br>What is a "non-triv=
ial situation"? That's kinds the problem with your idea: this use =
case simply doesn'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'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'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: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'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't think so, that'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'=
s logic doesn't follow the standard `for` rules. `for` exists for triv=
ial circumstances; if your circumstances are non-trivial, then it'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. "... I have myself i=
n
the past written loops where ..." doesn'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'm =
sure they can imagine a=C2=A0motivating case already. If not,=C2=A0they are=
simply in the set of people who don't find this issue motivating, so t=
hey=C2=A0never will be. Let's be realistic. I'm ok with that. And i=
n any case I'm not going to create an implementation or do any other th=
ings that people might have on there wish list, I'm just throwing the i=
dea out there and if that motivates an expert to run with the idea great, i=
f not, that's ok too as=C2=A0I'm sure there time is more valuable t=
han mine. But I don't buy that imagination here is the problem. So you&=
#39;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.</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's no point in giving =
it to them. I can't say that I find such an "argument" convin=
cing...<br></div></div></blockquote><div><br></div><div>Don't be convin=
ced then, that's ok.=C2=A0But=C2=A0I'm also allowed=C2=A0to find it=
unconvincing=C2=A0that anything will convince you=C2=A0and that's=C2=
=A0my prerogative too because=C2=A0this isn'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'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't say=
like where you "have to" 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'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" 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--
.
Author: Viacheslav Usov <via.usov@gmail.com>
Date: Tue, 26 Jul 2016 14:44:11 +0200
Raw View
--001a114065c008ed160538894216
Content-Type: text/plain; charset=UTF-8
On Mon, Jul 25, 2016 at 11:15 PM, <gmisocpp@gmail.com> wrote:
> I think we are in agreement that lambda's don't seem to be solve this
problem as cleanly as we'd like.
I think you have not demonstrated what "this problem" really is. This is
probably what the others in this thread have said.
You seem to want some new syntax for some very rare use case, not because
the current language means cannot handle that case, but because you dislike
those means, and, as far as I can tell, you have not given any substantial
technical reasons for your dislike. I doubt this will be universally
regarded as a problem worth fixing.
Cheers,
V.
--
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/CAA7YVg2qPDanOYwMucjC--qswdE6MtJSsbWctAC9rnzd%3D3dWgw%40mail.gmail.com.
--001a114065c008ed160538894216
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On M=
on, Jul 25, 2016 at 11:15 PM, <span dir=3D"ltr"><<a href=3D"mailto:gmis=
ocpp@gmail.com" target=3D"_blank">gmisocpp@gmail.com</a>></span> wrote:<=
br><div><br></div><div>> I think we are in agreement=C2=A0that=C2=A0lamb=
da's don't seem to be=C2=A0solve=C2=A0this problem as cleanly as we=
'd like.</div><div><br></div><div>I think you have not demonstrated wha=
t "this problem" really is. This is probably what the others in t=
his thread have said.</div><div><br></div><div>You seem to want some new sy=
ntax for some very rare use case, not because the current language means ca=
nnot handle that case, but because you dislike those means, and, as far as =
I can tell, you have not given any substantial technical reasons for your d=
islike. I doubt this will be universally regarded as a problem worth fixing=
..</div><div><br></div><div>Cheers,</div><div>V.</div></div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/CAA7YVg2qPDanOYwMucjC--qswdE6MtJSsbWc=
tAC9rnzd%3D3dWgw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAA7YVg2qPDanOY=
wMucjC--qswdE6MtJSsbWctAC9rnzd%3D3dWgw%40mail.gmail.com</a>.<br />
--001a114065c008ed160538894216--
.
Author: gmisocpp@gmail.com
Date: Tue, 26 Jul 2016 07:34:13 -0700 (PDT)
Raw View
------=_Part_704_367244351.1469543653874
Content-Type: multipart/alternative;
boundary="----=_Part_705_1620755172.1469543653874"
------=_Part_705_1620755172.1469543653874
Content-Type: text/plain; charset=UTF-8
On Wednesday, July 27, 2016 at 12:44:15 AM UTC+12, Viacheslav Usov wrote:
>
> On Mon, Jul 25, 2016 at 11:15 PM, <gmis...@gmail.com <javascript:>> wrote:
>
> > I think we are in agreement that lambda's don't seem to be solve this
> problem as cleanly as we'd like.
>
> I think you have not demonstrated what "this problem" really is. This is
> probably what the others in this thread have said.
>
> You seem to want some new syntax for some very rare use case, not because
> the current language means cannot handle that case, but because you dislike
> those means, and, as far as I can tell, you have not given any substantial
> technical reasons for your dislike. I doubt this will be universally
> regarded as a problem worth fixing.
>
> Cheers,
> V.
>
There is nothing more to state because the idea isn't complex. It is what
it appears be - a simple syntax for a small problem where the existing
syntax is workable but clumsy. If you're just saying you and the
majority so far think it' isn't a problem worth fixing, I agree that's what
they are saying and what I expected. But the idea is simple as is the
problem so if it doesn't sell it self, it won't, so I won't defend it
because it's pointless given what I believe. If people like the idea,
great, if they don't, ok too, just argue amongst yourselves about it. If
people get beyond just saying they don't like the idea or mischaracterising
what I said to begin with on the subject, I might join the conversation
later, but until some more interesting is said, leave me out of it.
--
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/4172dc53-3ed8-4de9-9a3e-55bdc8e7aa7d%40isocpp.org.
------=_Part_705_1620755172.1469543653874
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Wednesday, July 27, 2016 at 12:44:15 AM UTC+12,=
Viacheslav Usov wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0=
px 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><=
div class=3D"gmail_quote">On Mon, Jul 25, 2016 at 11:15 PM, <span dir=3D"l=
tr"><<a onmousedown=3D"this.href=3D'javascript:';return true;" o=
nclick=3D"this.href=3D'javascript:';return true;" href=3D"javascrip=
t:" target=3D"_blank" rel=3D"nofollow" gdf-obfuscated-mailto=3D"dF8vO5DPBAA=
J">gmis...@gmail.com</a>></span> wrote:<br><div><br></div><div>> I th=
ink we are in agreement=C2=A0that=C2=A0lambda's don't seem to be=C2=
=A0solve=C2=A0this problem as cleanly as we'd like.</div><div><br></div=
><div>I think you have not demonstrated what "this problem" reall=
y is. This is probably what the others in this thread have said.</div><div>=
<br></div><div>You seem to want some new syntax for some very rare use case=
, not because the current language means cannot handle that case, but becau=
se you dislike those means, and, as far as I can tell, you have not given a=
ny substantial technical reasons for your dislike. I doubt this will be uni=
versally regarded as a problem worth fixing.</div><div><br></div><div>Cheer=
s,</div><div>V.</div></div></div></div></blockquote><div><br></div><div>The=
re is nothing=C2=A0more to state because=C2=A0the idea isn't complex.=
=C2=A0It is what it appears be -=C2=A0a simple syntax for a small problem w=
here the existing syntax is workable but clumsy.=C2=A0If you're just sa=
ying you and the majority=C2=A0so far think it' isn't a=C2=A0proble=
m=C2=A0worth=C2=A0fixing,=C2=A0I agree that's what they are saying and =
what I expected.=C2=A0But the idea is simple=C2=A0as is the problem=C2=A0so=
if it doesn't=C2=A0sell it self,=C2=A0it won't, so I won't def=
end it because it's=C2=A0pointless given what I believe. If people like=
the idea, great, if they don't, ok too, just argue amongst yourselves =
about it. If people get beyond=C2=A0just saying they don't like=C2=A0th=
e idea=C2=A0or mischaracterising what I said to begin with on the subject,=
=C2=A0I might join the conversation later, but until some more interesting =
is said, leave me out of it.</div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/4172dc53-3ed8-4de9-9a3e-55bdc8e7aa7d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/4172dc53-3ed8-4de9-9a3e-55bdc8e7aa7d=
%40isocpp.org</a>.<br />
------=_Part_705_1620755172.1469543653874--
------=_Part_704_367244351.1469543653874--
.
Author: szollosi.lorand@gmail.com
Date: Thu, 28 Jul 2016 07:50:17 -0700 (PDT)
Raw View
------=_Part_110_842022123.1469717417849
Content-Type: multipart/alternative;
boundary="----=_Part_111_55776959.1469717417849"
------=_Part_111_55776959.1469717417849
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Hi,
Just to jump in :), I was the one who wrote the other idea-for-proposal=20
mail and I'd be more than happy to merge the two threads. My intention on=
=20
the other thread is to re-think all the looping concepts of C++, possibly=
=20
by getting feedback from other languages' users and come up with a set of=
=20
possible extensions like a tick list. This includes schematics *and*=20
syntax. That way, when/if we'll propose it to the Std's Committee, they'll=
=20
have options rather than me myself saying what's the best solution.
That said, don't expect that thread to be quick. I'd rather make a proper=
=20
proposal once than 20 revisions.
Regards,
-lorro
2016. j=C3=BAlius 26., kedd 16:34:13 UTC+2 id=C5=91pontban gmis...@gmail.co=
m a=20
k=C3=B6vetkez=C5=91t =C3=ADrta:
>
>
>
> On Wednesday, July 27, 2016 at 12:44:15 AM UTC+12, Viacheslav Usov wrote:
>>
>> On Mon, Jul 25, 2016 at 11:15 PM, <gmis...@gmail.com> wrote:
>>
>> > I think we are in agreement that lambda's don't seem to be solve this=
=20
>> problem as cleanly as we'd like.
>>
>> I think you have not demonstrated what "this problem" really is. This is=
=20
>> probably what the others in this thread have said.
>>
>> You seem to want some new syntax for some very rare use case, not becaus=
e=20
>> the current language means cannot handle that case, but because you disl=
ike=20
>> those means, and, as far as I can tell, you have not given any substanti=
al=20
>> technical reasons for your dislike. I doubt this will be universally=20
>> regarded as a problem worth fixing.
>>
>> Cheers,
>> V.
>>
>
> There is nothing more to state because the idea isn't complex. It is what=
=20
> it appears be - a simple syntax for a small problem where the existing=20
> syntax is workable but clumsy. If you're just saying you and the=20
> majority so far think it' isn't a problem worth fixing, I agree that's wh=
at=20
> they are saying and what I expected. But the idea is simple as is the=20
> problem so if it doesn't sell it self, it won't, so I won't defend it=20
> because it's pointless given what I believe. If people like the idea,=20
> great, if they don't, ok too, just argue amongst yourselves about it. If=
=20
> people get beyond just saying they don't like the idea or mischaracterisi=
ng=20
> what I said to begin with on the subject, I might join the conversation=
=20
> later, but until some more interesting is said, leave me out of it.
>
--=20
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 e=
mail 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/9726d095-5beb-4550-8951-0ff8cca5ac12%40isocpp.or=
g.
------=_Part_111_55776959.1469717417849
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hi,<br><br>Just to jump in :), I was the one who wrote the=
other idea-for-proposal mail and I'd be more than happy to merge the t=
wo threads. My intention on the other thread is to re-think all the looping=
concepts of C++, possibly by getting feedback from other languages' us=
ers and come up with a set of possible extensions like a tick list. This in=
cludes schematics <i>and</i> syntax. That way, when/if we'll propose it=
to the Std's Committee, they'll have options rather than me myself=
saying what's the best solution.<br>That said, don't expect that t=
hread to be quick. I'd rather make a proper proposal once than 20 revis=
ions.<br><br>Regards,<br>-lorro<br><br>2016. j=C3=BAlius 26., kedd 16:34:13=
UTC+2 id=C5=91pontban gmis...@gmail.com a k=C3=B6vetkez=C5=91t =C3=ADrta:<=
blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;bord=
er-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><br><br>On Wed=
nesday, July 27, 2016 at 12:44:15 AM UTC+12, Viacheslav Usov wrote:<blockqu=
ote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;padding-left:1e=
x;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-styl=
e:solid"><div dir=3D"ltr"><div><div class=3D"gmail_quote">On Mon, Jul 25, 2=
016 at 11:15 PM, <span dir=3D"ltr"><<a rel=3D"nofollow">gmis...@gmail.c=
om</a>></span> wrote:<br><div><br></div><div>> I think we are in agre=
ement=C2=A0that=C2=A0lambda's don't seem to be=C2=A0solve=C2=A0this=
problem as cleanly as we'd like.</div><div><br></div><div>I think you =
have not demonstrated what "this problem" really is. This is prob=
ably what the others in this thread have said.</div><div><br></div><div>You=
seem to want some new syntax for some very rare use case, not because the =
current language means cannot handle that case, but because you dislike tho=
se means, and, as far as I can tell, you have not given any substantial tec=
hnical reasons for your dislike. I doubt this will be universally regarded =
as a problem worth fixing.</div><div><br></div><div>Cheers,</div><div>V.</d=
iv></div></div></div></blockquote><div><br></div><div>There is nothing=C2=
=A0more to state because=C2=A0the idea isn't complex.=C2=A0It is what i=
t appears be -=C2=A0a simple syntax for a small problem where the existing =
syntax is workable but clumsy.=C2=A0If you're just saying you and the m=
ajority=C2=A0so far think it' isn't a=C2=A0problem=C2=A0worth=C2=A0=
fixing,=C2=A0I agree that's what they are saying and what I expected.=
=C2=A0But the idea is simple=C2=A0as is the problem=C2=A0so if it doesn'=
;t=C2=A0sell it self,=C2=A0it won't, so I won't defend it because i=
t's=C2=A0pointless given what I believe. If people like the idea, great=
, if they don't, ok too, just argue amongst yourselves about it. If peo=
ple get beyond=C2=A0just saying they don't like=C2=A0the idea=C2=A0or m=
ischaracterising what I said to begin with on the subject,=C2=A0I might joi=
n the conversation later, but until some more interesting is said, leave me=
out of it.</div></div></blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/9726d095-5beb-4550-8951-0ff8cca5ac12%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/9726d095-5beb-4550-8951-0ff8cca5ac12=
%40isocpp.org</a>.<br />
------=_Part_111_55776959.1469717417849--
------=_Part_110_842022123.1469717417849--
.