Topic: safe switch


Author: Arthur Tchaikovsky <atch.cpp@gmail.com>
Date: Wed, 1 Jul 2015 11:07:33 -0700 (PDT)
Raw View
------=_Part_14_559554000.1435774053197
Content-Type: multipart/alternative;
 boundary="----=_Part_15_593187787.1435774053198"

------=_Part_15_593187787.1435774053198
Content-Type: text/plain; charset=UTF-8

Hi,

I propos safe switch . How it works? It works the way that it is *compiler
error* if there are any fall-through cases. I believe 99% of such cases are
errors. For the one percent which really needs that fall-through mechanics,
just add [[delete]] attribute, meaning delete safe switch mechanics, so it
looks like so:

/*Non breaking change, only detects potentially *erroneous code**/
switch (value)
{
case 1:
f();
case 2:
g();
}

^^^this should cause error, according to what I'd propose.

switch[[delete]] (value)
{
case 1:
f();
case 2:
g();
}
^^^this should be allowed, as the programmer clearly stated, that
fall-through is OK in this switch.

Looking forward to your opinions

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_15_593187787.1435774053198
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi,<br><br>I propos safe switch . How it works? It=20
works the way that it is *compiler error* if there are any fall-through=20
cases. I believe 99% of such cases are errors. For the one percent which
 really needs that fall-through mechanics, just add [[delete]]=20
attribute, meaning delete safe switch mechanics, so it looks like so:<br><b=
r>/*Non breaking change, only detects potentially *erroneous code**/<br>swi=
tch (value)<br>{<br>case 1:<br>f();<br>case 2:<br>g();<br>}<br><br>^^^this =
should cause error, according to what I'd propose.<br><br>switch[[delete]] =
(value)<br>{<br>case 1:<br>f();<br>case 2:<br>g();<br>}<br>^^^this should b=
e allowed, as the programmer clearly stated, that fall-through is OK in thi=
s switch.<br><br>Looking forward to your opinions<br></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_15_593187787.1435774053198--
------=_Part_14_559554000.1435774053197--

.


Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Wed, 1 Jul 2015 21:17:46 +0300
Raw View
On 1 July 2015 at 21:07, Arthur Tchaikovsky <atch.cpp@gmail.com> wrote:
> Hi,
>
> I propos safe switch . How it works? It works the way that it is *compiler
> error* if there are any fall-through cases. I believe 99% of such cases are

The committee already considered that as part of this proposal
http://open-std.org/JTC1/SC22/WG21/docs/papers/2014/n3879.pdf
and rejected the idea.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: =?UTF-8?Q?Daniel_Kr=C3=BCgler?= <daniel.kruegler@gmail.com>
Date: Wed, 1 Jul 2015 20:20:59 +0200
Raw View
2015-07-01 20:07 GMT+02:00 Arthur Tchaikovsky <atch.cpp@gmail.com>:
> Hi,
>
> I propos safe switch . How it works? It works the way that it is *compiler
> error* if there are any fall-through cases. I believe 99% of such cases are
> errors. For the one percent which really needs that fall-through mechanics,
> just add [[delete]] attribute, meaning delete safe switch mechanics, so it
> looks like so:
>
> /*Non breaking change, only detects potentially *erroneous code**/
> switch (value)
> {
> case 1:
> f();
> case 2:
> g();
> }
>
> ^^^this should cause error, according to what I'd propose.
>
> switch[[delete]] (value)
> {
> case 1:
> f();
> case 2:
> g();
> }
> ^^^this should be allowed, as the programmer clearly stated, that
> fall-through is OK in this switch.
>
> Looking forward to your opinions

a) I don't understand why you suggest an attribute for the second
approach, why wouldn't

switch delete (value)
{
  ...
}

work as well? (delete is already a key word)

b) Personally I would feel better if the existing semantics of switch
statement wouldn't be changed. You could realize the same effect if
you would invent a new switch statement, let's say

switch new (value)
{
  ...
}

that has the semantics of your first example. Have you considered that
alternative?

- Daniel

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Wed, 1 Jul 2015 21:22:26 +0300
Raw View
On 1 July 2015 at 21:20, Daniel Kr=C3=BCgler <daniel.kruegler@gmail.com> wr=
ote:
> 2015-07-01 20:07 GMT+02:00 Arthur Tchaikovsky <atch.cpp@gmail.com>:
>> Hi,
>>
>> I propos safe switch . How it works? It works the way that it is *compil=
er
>> error* if there are any fall-through cases. I believe 99% of such cases =
are
>> errors. For the one percent which really needs that fall-through mechani=
cs,
>> just add [[delete]] attribute, meaning delete safe switch mechanics, so =
it
>> looks like so:
>>
>> /*Non breaking change, only detects potentially *erroneous code**/
>> switch (value)
>> {
>> case 1:
>> f();
>> case 2:
>> g();
>> }
>>
>> ^^^this should cause error, according to what I'd propose.
>>
>> switch[[delete]] (value)
>> {
>> case 1:
>> f();
>> case 2:
>> g();
>> }
>> ^^^this should be allowed, as the programmer clearly stated, that
>> fall-through is OK in this switch.
>>
>> Looking forward to your opinions
>
> a) I don't understand why you suggest an attribute for the second
> approach, why wouldn't
>
> switch delete (value)
> {
>   ...
> }
>
> work as well? (delete is already a key word)
>
> b) Personally I would feel better if the existing semantics of switch
> statement wouldn't be changed. You could realize the same effect if
> you would invent a new switch statement, let's say
>
> switch new (value)
> {
>   ...
> }
>
> that has the semantics of your first example. Have you considered that
> alternative?

Also note that we have had this discussion previously:
https://groups.google.com/a/isocpp.org/d/msg/std-discussion/q4KhZaN9IOY/_dB=
QrZ3BI3MJ

--=20

---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

.


Author: =?UTF-8?Q?Daniel_Kr=C3=BCgler?= <daniel.kruegler@gmail.com>
Date: Wed, 1 Jul 2015 20:23:21 +0200
Raw View
2015-07-01 20:17 GMT+02:00 Ville Voutilainen <ville.voutilainen@gmail.com>:
> On 1 July 2015 at 21:07, Arthur Tchaikovsky <atch.cpp@gmail.com> wrote:
>> Hi,
>>
>> I propos safe switch . How it works? It works the way that it is *compiler
>> error* if there are any fall-through cases. I believe 99% of such cases are
>
> The committee already considered that as part of this proposal
> http://open-std.org/JTC1/SC22/WG21/docs/papers/2014/n3879.pdf
> and rejected the idea.

To me N3879 is related, but was actually suggesting something else. It
didn't change the meaning of the existing switch statement (good!),
but it allowed also fall-throughs in the explicit switch.

- Daniel

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Wed, 1 Jul 2015 21:28:20 +0300
Raw View
On 1 July 2015 at 21:23, Daniel Kr=C3=BCgler <daniel.kruegler@gmail.com> wr=
ote:
>> The committee already considered that as part of this proposal
>> http://open-std.org/JTC1/SC22/WG21/docs/papers/2014/n3879.pdf
>> and rejected the idea.
>
> To me N3879 is related, but was actually suggesting something else. It
> didn't change the meaning of the existing switch statement (good!),
> but it allowed also fall-throughs in the explicit switch.


Then again, there's these dulcet tones from the Rapperswil discussion,
pointing out some
amounts of resistance to the general idea, not to some specific way to do i=
t:
"We need more complicated control structures like a hole in the head.
These proposed constructs make writing bad code easier. It encourages
people to write the worst kind of code I know. The explicit switch
gives us two kinds of switch statements that complicates teaching.
It's better than the current switch, but we can't go back in time, the
old stuff isn't going to go away. This attempt to solve the problem
would have worked nicely in 1972, but it's a few billion lines of code
too late and solves the wrong problem. "

--=20

---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

.


Author: roberto parolin <robertoparolin@gmail.com>
Date: Wed, 01 Jul 2015 19:01:15 +0000
Raw View
--001a11376bdc07815b0519d4f3bf
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Bigger fish to fry in my opinion.  Not worth committee time.

Not generally a fan of opt in unsafe constructs.  Still allows the unsafe
code to be accepted.  In this case the problem is well understood and in my
experience does not get past peer code review.

On Wed, 1 Jul 2015 11:28 am Ville Voutilainen <ville.voutilainen@gmail.com>
wrote:

> On 1 July 2015 at 21:23, Daniel Kr=C3=BCgler <daniel.kruegler@gmail.com> =
wrote:
> >> The committee already considered that as part of this proposal
> >> http://open-std.org/JTC1/SC22/WG21/docs/papers/2014/n3879.pdf
> >> and rejected the idea.
> >
> > To me N3879 is related, but was actually suggesting something else. It
> > didn't change the meaning of the existing switch statement (good!),
> > but it allowed also fall-throughs in the explicit switch.
>
>
> Then again, there's these dulcet tones from the Rapperswil discussion,
> pointing out some
> amounts of resistance to the general idea, not to some specific way to do
> it:
> "We need more complicated control structures like a hole in the head.
> These proposed constructs make writing bad code easier. It encourages
> people to write the worst kind of code I know. The explicit switch
> gives us two kinds of switch statements that complicates teaching.
> It's better than the current switch, but we can't go back in time, the
> old stuff isn't going to go away. This attempt to solve the problem
> would have worked nicely in 1972, but it's a few billion lines of code
> too late and solves the wrong problem. "
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>

--=20

---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--001a11376bdc07815b0519d4f3bf
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<p dir=3D"ltr">Bigger fish to fry in my opinion.=C2=A0 Not worth committee =
time.</p>
<p dir=3D"ltr">Not generally a fan of opt in unsafe constructs.=C2=A0 Still=
 allows the unsafe code to be accepted.=C2=A0 In this case the problem is w=
ell understood and in my experience does not get past peer code review.</p>
<br><div class=3D"gmail_quote"><div dir=3D"ltr">On Wed, 1 Jul 2015 11:28 am=
=C2=A0Ville Voutilainen &lt;<a href=3D"mailto:ville.voutilainen@gmail.com">=
ville.voutilainen@gmail.com</a>&gt; wrote:<br></div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-le=
ft:1ex">On 1 July 2015 at 21:23, Daniel Kr=C3=BCgler &lt;<a href=3D"mailto:=
daniel.kruegler@gmail.com" target=3D"_blank">daniel.kruegler@gmail.com</a>&=
gt; wrote:<br>
&gt;&gt; The committee already considered that as part of this proposal<br>
&gt;&gt; <a href=3D"http://open-std.org/JTC1/SC22/WG21/docs/papers/2014/n38=
79.pdf" rel=3D"noreferrer" target=3D"_blank">http://open-std.org/JTC1/SC22/=
WG21/docs/papers/2014/n3879.pdf</a><br>
&gt;&gt; and rejected the idea.<br>
&gt;<br>
&gt; To me N3879 is related, but was actually suggesting something else. It=
<br>
&gt; didn&#39;t change the meaning of the existing switch statement (good!)=
,<br>
&gt; but it allowed also fall-throughs in the explicit switch.<br>
<br>
<br>
Then again, there&#39;s these dulcet tones from the Rapperswil discussion,<=
br>
pointing out some<br>
amounts of resistance to the general idea, not to some specific way to do i=
t:<br>
&quot;We need more complicated control structures like a hole in the head.<=
br>
These proposed constructs make writing bad code easier. It encourages<br>
people to write the worst kind of code I know. The explicit switch<br>
gives us two kinds of switch statements that complicates teaching.<br>
It&#39;s better than the current switch, but we can&#39;t go back in time, =
the<br>
old stuff isn&#39;t going to go away. This attempt to solve the problem<br>
would have worked nicely in 1972, but it&#39;s a few billion lines of code<=
br>
too late and solves the wrong problem. &quot;<br>
<br>
--<br>
<br>
---<br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" rel=3D"noreferrer" target=3D"_blank">http://groups.google.c=
om/a/isocpp.org/group/std-proposals/</a>.<br>
</blockquote></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a11376bdc07815b0519d4f3bf--

.


Author: Jim Porter <jvp4846@g.rit.edu>
Date: Wed, 1 Jul 2015 14:20:29 -0500
Raw View
On 7/1/2015 1:07 PM, Arthur Tchaikovsky wrote:
> I propos safe switch . How it works? It works the way that it is
> *compiler error* if there are any fall-through cases.

Given how long switch statements have been the way they are, I think
you'd stand a better chance of making forward progress if you talked to
compiler authors first, and added some extension that lets you indicate
when you wish to fall through. Then you have the safe code you want, and
if it got popular, you could try to standardize the existing practice of
using the explicit fallthrough.

And hey, if it never got standardized, at least your code is still safe.

- Jim


--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: Matthew Woehlke <mwoehlke.floss@gmail.com>
Date: Wed, 01 Jul 2015 15:32:40 -0400
Raw View
On 2015-07-01 15:20, Jim Porter wrote:
> On 7/1/2015 1:07 PM, Arthur Tchaikovsky wrote:
>> I propos safe switch . How it works? It works the way that it is
>> *compiler error* if there are any fall-through cases.
>
> Given how long switch statements have been the way they are, I think
> you'd stand a better chance of making forward progress if you talked to
> compiler authors first, and added some extension that lets you indicate
> when you wish to fall through. Then you have the safe code you want, and
> if it got popular, you could try to standardize the existing practice of
> using the explicit fallthrough.
>
> And hey, if it never got standardized, at least your code is still safe.

You mean something like [[clang::fallthrough]]? I've suggested before
standardizing [[fallthrough]]... unfortunately IIRC that got about the
same reaction :-(.

What would be best IMHO would be if we could standardize some
(non-attribute) syntax to specify fallthrough, and then deprecate
implicit fallthrough except in the case of an empty case block. (Bonus
points for also supporting multiple cases in a more explicit manner than
implicit fallthrough and then deprecating *all* implicit fallthrough.)

Some form of 'continue' (even "continue case X") has been previously
suggested. Or we could be cute and use "do not break" ;-). I'm not in
love with any of those, however.

--
Matthew

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: David Krauss <potswa@gmail.com>
Date: Thu, 2 Jul 2015 11:01:41 +0800
Raw View
--Apple-Mail=_3080BDBE-01EA-42C8-85A5-F329C38C082B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


> On 2015=E2=80=9307=E2=80=9302, at 2:20 AM, Daniel Kr=C3=BCgler <daniel.kr=
uegler@gmail.com> wrote:
>=20
> You could realize the same effect if
> you would invent a new switch statement, let's say
>=20
> switch new (value)
> {
>  ...
> }

Or =E2=80=9CSWITCH.=E2=80=9D Get the library: https://github.com/potswa/saf=
e_switch

    SWITCH ( condition )
    CASE ( A ) {
        foo();
    }
    CASE ({ B, C }) {
        bar();
    }
    DEFAULT {
        baz();
    }

Without macros:

    auto case_ =3D bind_comparator( condition );
    if ( case_( A ) ) {
        foo();
    } else if ( case_({ B, C }) ) {
        bar();
    } else {
        baz();
    }


> On 2015=E2=80=9307=E2=80=9302, at 2:07 AM, Arthur Tchaikovsky <atch.cpp@g=
mail.com> wrote:
>=20
> For the one percent which really needs that fall-through mechanics, just =
add [[delete]] attribute

That=E2=80=99s not how large numbers work. 1% of a lot is still a lot. Frac=
tions don=E2=80=99t even make a reasonable argument in the first place.

switch with fallthrough is currently the best way to implement coroutines: =
a persistent variable is set before break so the switch can subsequently re=
sume execution from a nearby case. Recent such usage includes the Boost.Asi=
o and Mach7 pattern-matching libraries. Even the recent coroutine proposals=
 will not completely supplant this.

Usage in modern, generalized libraries is usually wrapped in macros, someti=
mes deeply. =E2=80=9CJust adding=E2=80=9D something in a header like this <=
https://github.com/solodon4/Mach7/blob/master/code/match.hpp> takes guts. T=
here are several switch statements there and I don=E2=80=99t know which one=
s are memoized. (All? Just one?)

Changing the behavior of switch is a fantasy. Change your own behavior inst=
ead.

--=20

---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--Apple-Mail=_3080BDBE-01EA-42C8-85A5-F329C38C082B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><br class=3D""><di=
v><blockquote type=3D"cite" class=3D""><div class=3D"">On 2015=E2=80=9307=
=E2=80=9302, at 2:20 AM, Daniel Kr=C3=BCgler &lt;<a href=3D"mailto:daniel.k=
ruegler@gmail.com" class=3D"">daniel.kruegler@gmail.com</a>&gt; wrote:</div=
><br class=3D"Apple-interchange-newline"><div class=3D""><span style=3D"fon=
t-family: Helvetica; font-size: 12px; font-style: normal; font-variant: nor=
mal; font-weight: normal; letter-spacing: normal; line-height: normal; orph=
ans: auto; text-align: start; text-indent: 0px; text-transform: none; white=
-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width:=
 0px; float: none; display: inline !important;" class=3D"">You could realiz=
e the same effect if</span><br style=3D"font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant: normal; font-weight: normal; letter=
-spacing: normal; line-height: normal; orphans: auto; text-align: start; te=
xt-indent: 0px; text-transform: none; white-space: normal; widows: auto; wo=
rd-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><span style=3D=
"font-family: Helvetica; font-size: 12px; font-style: normal; font-variant:=
 normal; font-weight: normal; letter-spacing: normal; line-height: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: none; w=
hite-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-wi=
dth: 0px; float: none; display: inline !important;" class=3D"">you would in=
vent a new switch statement, let's say</span><br style=3D"font-family: Helv=
etica; font-size: 12px; font-style: normal; font-variant: normal; font-weig=
ht: normal; letter-spacing: normal; line-height: normal; orphans: auto; tex=
t-align: start; text-indent: 0px; text-transform: none; white-space: normal=
; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=
=3D""><br style=3D"font-family: Helvetica; font-size: 12px; font-style: nor=
mal; font-variant: normal; font-weight: normal; letter-spacing: normal; lin=
e-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-=
transform: none; white-space: normal; widows: auto; word-spacing: 0px; -web=
kit-text-stroke-width: 0px;" class=3D""><span style=3D"font-family: Helveti=
ca; font-size: 12px; font-style: normal; font-variant: normal; font-weight:=
 normal; letter-spacing: normal; line-height: normal; orphans: auto; text-a=
lign: start; text-indent: 0px; text-transform: none; white-space: normal; w=
idows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none=
; display: inline !important;" class=3D"">switch new (value)</span><br styl=
e=3D"font-family: Helvetica; font-size: 12px; font-style: normal; font-vari=
ant: normal; font-weight: normal; letter-spacing: normal; line-height: norm=
al; orphans: auto; text-align: start; text-indent: 0px; text-transform: non=
e; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-strok=
e-width: 0px;" class=3D""><span style=3D"font-family: Helvetica; font-size:=
 12px; font-style: normal; font-variant: normal; font-weight: normal; lette=
r-spacing: normal; line-height: normal; orphans: auto; text-align: start; t=
ext-indent: 0px; text-transform: none; white-space: normal; widows: auto; w=
ord-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inl=
ine !important;" class=3D"">{</span><br style=3D"font-family: Helvetica; fo=
nt-size: 12px; font-style: normal; font-variant: normal; font-weight: norma=
l; letter-spacing: normal; line-height: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; widows:=
 auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><span=
 style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; font=
-variant: normal; font-weight: normal; letter-spacing: normal; line-height:=
 normal; orphans: auto; text-align: start; text-indent: 0px; text-transform=
: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-=
stroke-width: 0px; float: none; display: inline !important;" class=3D"">&nb=
sp;...</span><br style=3D"font-family: Helvetica; font-size: 12px; font-sty=
le: normal; font-variant: normal; font-weight: normal; letter-spacing: norm=
al; line-height: normal; orphans: auto; text-align: start; text-indent: 0px=
; text-transform: none; white-space: normal; widows: auto; word-spacing: 0p=
x; -webkit-text-stroke-width: 0px;" class=3D""><span style=3D"font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-=
weight: normal; letter-spacing: normal; line-height: normal; orphans: auto;=
 text-align: start; text-indent: 0px; text-transform: none; white-space: no=
rmal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; floa=
t: none; display: inline !important;" class=3D"">}</span><br style=3D"font-=
family: Helvetica; font-size: 12px; font-style: normal; font-variant: norma=
l; font-weight: normal; letter-spacing: normal; line-height: normal; orphan=
s: auto; text-align: start; text-indent: 0px; text-transform: none; white-s=
pace: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0=
px;" class=3D""></div></blockquote></div><br class=3D""><div class=3D"">Or =
=E2=80=9C<font face=3D"Courier" class=3D"">SWITCH</font>.=E2=80=9D Get the =
library:&nbsp;<a href=3D"https://github.com/potswa/safe_switch" class=3D"">=
https://github.com/potswa/safe_switch</a></div><div class=3D""><br class=3D=
""></div><div class=3D""><div class=3D""><font face=3D"Courier" class=3D"">=
&nbsp; &nbsp; SWITCH ( condition )</font></div><div class=3D""><font face=
=3D"Courier" class=3D"">&nbsp; &nbsp; CASE ( A ) {</font></div><div class=
=3D""><font face=3D"Courier" class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; foo();<=
/font></div><div class=3D""><font face=3D"Courier" class=3D"">&nbsp; &nbsp;=
 }</font></div><div class=3D""><font face=3D"Courier" class=3D"">&nbsp; &nb=
sp; CASE ({ B, C }) {</font></div><div class=3D""><font face=3D"Courier" cl=
ass=3D"">&nbsp; &nbsp; &nbsp; &nbsp; bar();</font></div><div class=3D""><fo=
nt face=3D"Courier" class=3D"">&nbsp; &nbsp; }</font></div><div class=3D"">=
<font face=3D"Courier" class=3D"">&nbsp; &nbsp; DEFAULT {</font></div><div =
class=3D""><font face=3D"Courier" class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; ba=
z();</font></div><div class=3D""><font face=3D"Courier" class=3D"">&nbsp; &=
nbsp; }</font></div></div><div class=3D""><br class=3D""></div><div class=
=3D"">Without macros:</div><div class=3D""><br class=3D""></div><div class=
=3D""><div class=3D""><font face=3D"Courier" class=3D"">&nbsp; &nbsp; auto =
case_ =3D bind_comparator( condition );</font></div><div class=3D""><font f=
ace=3D"Courier" class=3D"">&nbsp; &nbsp; if ( case_( A ) ) {</font></div><d=
iv class=3D""><font face=3D"Courier" class=3D"">&nbsp; &nbsp; &nbsp; &nbsp;=
 foo();</font></div><div class=3D""><font face=3D"Courier" class=3D"">&nbsp=
; &nbsp; } else if ( case_({ B, C }) ) {</font></div><div class=3D""><font =
face=3D"Courier" class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; bar();</font></div>=
<div class=3D""><font face=3D"Courier" class=3D"">&nbsp; &nbsp; } else {</f=
ont></div><div class=3D""><font face=3D"Courier" class=3D"">&nbsp; &nbsp; &=
nbsp; &nbsp; baz();</font></div><div class=3D""><font face=3D"Courier" clas=
s=3D"">&nbsp; &nbsp; }</font></div></div><div class=3D""><br class=3D""></d=
iv><div class=3D""><br class=3D""></div><div class=3D""><div class=3D""></d=
iv></div><blockquote type=3D"cite" class=3D""><div class=3D""><div class=3D=
"">On 2015=E2=80=9307=E2=80=9302, at 2:07 AM, Arthur Tchaikovsky &lt;<a hre=
f=3D"mailto:atch.cpp@gmail.com" class=3D"">atch.cpp@gmail.com</a>&gt; wrote=
:</div><br class=3D"Apple-interchange-newline"><div class=3D""><span class=
=3D"" style=3D"float: none; display: inline !important;">For the one percen=
t which really needs that fall-through mechanics, just add [[delete]] attri=
bute</span></div></div></blockquote><div class=3D""><span class=3D"" style=
=3D"float: none; display: inline !important;"><br class=3D""></span></div><=
div class=3D""><span class=3D"" style=3D"float: none; display: inline !impo=
rtant;">That=E2=80=99s not how large numbers work. 1% of a lot is still a l=
ot. Fractions don=E2=80=99t even make a reasonable argument in the first pl=
ace.</span></div><div class=3D""><span class=3D"" style=3D"float: none; dis=
play: inline !important;"><br class=3D""></span></div><div class=3D""><font=
 face=3D"Courier" class=3D"">switch</font>&nbsp;with fallthrough is current=
ly the best way to implement coroutines: a persistent variable is set befor=
e <font face=3D"Courier" class=3D"">break</font> so the&nbsp;<span style=3D=
"font-family: Courier;" class=3D"">switch</span>&nbsp;can subsequently resu=
me execution from a nearby <font face=3D"Courier" class=3D"">case</font>. R=
ecent such usage includes the Boost.Asio and Mach7 pattern-matching librari=
es. Even the recent coroutine proposals will not completely supplant this.<=
/div><div class=3D""><br class=3D""></div><div class=3D"">Usage in modern, =
generalized libraries is usually wrapped in macros, sometimes deeply. =E2=
=80=9CJust adding=E2=80=9D something in a header like&nbsp;<a href=3D"https=
://github.com/solodon4/Mach7/blob/master/code/match.hpp" class=3D"">this</a=
>&nbsp;takes guts. There are several <font face=3D"Courier" class=3D"">swit=
ch</font> statements there and I don=E2=80=99t know which ones are memoized=
.. (All? Just one?)</div><div class=3D""><br class=3D""></div><div class=3D"=
">Changing the behavior of <font face=3D"Courier" class=3D"">switch</font> =
is a fantasy. Change your own behavior instead.</div><div class=3D""><br cl=
ass=3D""></div></body></html>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--Apple-Mail=_3080BDBE-01EA-42C8-85A5-F329C38C082B--

.


Author: Arthur Tchaikovsky <atch.cpp@gmail.com>
Date: Thu, 2 Jul 2015 00:30:37 -0700 (PDT)
Raw View
------=_Part_2850_729094443.1435822237574
Content-Type: multipart/alternative;
 boundary="----=_Part_2851_348613719.1435822237575"

------=_Part_2851_348613719.1435822237575
Content-Type: text/plain; charset=UTF-8



On Thursday, 2 July 2015 04:01:53 UTC+1, David Krauss wrote:
>
>
> Without macros:
>
>     auto case_ = bind_comparator( condition );
>     if ( case_( A ) ) {
>         foo();
>     } else if ( case_({ B, C }) ) {
>         bar();
>     } else {
>         baz();
>     }
>
> ^^^This is just a very convulted way of using if, isn't it?!
>
>
> switch with fallthrough is currently the best way to implement
> coroutines:
>
> And my proposal also allows fallthrough.


--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_2851_348613719.1435822237575
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><br>On Thursday, 2 July 2015 04:01:53 UTC+1, David Krauss  wrote:<block=
quote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-le=
ft: 1px #ccc solid;padding-left: 1ex;"><div style=3D"word-wrap:break-word">=
<br><div>Without macros:</div><div><br></div><div><div><font face=3D"Courie=
r">&nbsp; &nbsp; auto case_ =3D bind_comparator( condition );</font></div><=
div><font face=3D"Courier">&nbsp; &nbsp; if ( case_( A ) ) {</font></div><d=
iv><font face=3D"Courier">&nbsp; &nbsp; &nbsp; &nbsp; foo();</font></div><d=
iv><font face=3D"Courier">&nbsp; &nbsp; } else if ( case_({ B, C }) ) {</fo=
nt></div><div><font face=3D"Courier">&nbsp; &nbsp; &nbsp; &nbsp; bar();</fo=
nt></div><div><font face=3D"Courier">&nbsp; &nbsp; } else {</font></div><di=
v><font face=3D"Courier">&nbsp; &nbsp; &nbsp; &nbsp; baz();</font></div><di=
v><font face=3D"Courier">&nbsp; &nbsp; }</font></div></div><div><br></div><=
div>^^^This is just a very convulted way of using if, isn't it?!<br></div><=
div><div></div></div><br><div><span style=3D"float:none;display:inline!impo=
rtant"><br></span></div><font face=3D"Courier">switch</font>&nbsp;with fall=
through is currently the best way to implement coroutines: <div><br></div><=
/div></blockquote><div>And my proposal also allows fallthrough.<br>&nbsp;<b=
r></div><br>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_2851_348613719.1435822237575--
------=_Part_2850_729094443.1435822237574--

.


Author: Arthur Tchaikovsky <atch.cpp@gmail.com>
Date: Thu, 2 Jul 2015 00:34:04 -0700 (PDT)
Raw View
------=_Part_2655_484462185.1435822444448
Content-Type: multipart/alternative;
 boundary="----=_Part_2656_1245437518.1435822444448"

------=_Part_2656_1245437518.1435822444448
Content-Type: text/plain; charset=UTF-8



On Thursday, 2 July 2015 04:01:53 UTC+1, David Krauss wrote:
>
>
>
> Changing the behavior of switch is a fantasy. Change your own behavior
> instead.
>
> Another rude reply. And behavior. Unbelievable.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_2656_1245437518.1435822444448
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Thursday, 2 July 2015 04:01:53 UTC+1, David Kra=
uss  wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left=
: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div style=3D"word-=
wrap:break-word"><br><div><br></div><div>Changing the behavior of <font fac=
e=3D"Courier">switch</font> is a fantasy. Change your own behavior instead.=
</div><div><br></div></div></blockquote><div>Another rude reply. And behavi=
or. Unbelievable. <br></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_2656_1245437518.1435822444448--
------=_Part_2655_484462185.1435822444448--

.


Author: Nevin Liber <nevin@eviloverlord.com>
Date: Thu, 2 Jul 2015 00:42:46 -0700
Raw View
--047d7bb03a9237194b0519df982f
Content-Type: text/plain; charset=UTF-8

On 2 July 2015 at 00:34, Arthur Tchaikovsky <atch.cpp@gmail.com> wrote:

>
>
> On Thursday, 2 July 2015 04:01:53 UTC+1, David Krauss wrote:
>>
>>
>>
>> Changing the behavior of switch is a fantasy. Change your own behavior
>> instead.
>>
>> Another rude reply. And behavior. Unbelievable.
>

Some of us think it is rude to ask for opinions on something they already
asked in the past.   And it isn't like this is the first time you've done
it...
--
 Nevin ":-)" Liber  <mailto:nevin@eviloverlord.com>  (847) 691-1404

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--047d7bb03a9237194b0519df982f
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On 2 July 2015 at 00:34, Arthur Tchaikovsky <span dir=3D"l=
tr">&lt;<a href=3D"mailto:atch.cpp@gmail.com" target=3D"_blank">atch.cpp@gm=
ail.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"g=
mail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bo=
rder-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><span class=3D"=
"><br><br>On Thursday, 2 July 2015 04:01:53 UTC+1, David Krauss  wrote:</sp=
an><span class=3D""><blockquote class=3D"gmail_quote" style=3D"margin:0;mar=
gin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div style=3D"w=
ord-wrap:break-word"><br><div><br></div><div>Changing the behavior of <font=
 face=3D"Courier">switch</font> is a fantasy. Change your own behavior inst=
ead.</div><div><br></div></div></blockquote></span><div>Another rude reply.=
 And behavior. Unbelievable. <br></div></div></blockquote><div><br></div><d=
iv>Some of us think it is rude to ask for opinions on something they alread=
y asked in the past. =C2=A0 And it isn&#39;t like this is the first time yo=
u&#39;ve done it...</div></div>-- <br><div class=3D"gmail_signature">=C2=A0=
Nevin &quot;:-)&quot; Liber=C2=A0 &lt;mailto:<a href=3D"mailto:nevin@evilov=
erlord.com" target=3D"_blank">nevin@eviloverlord.com</a>&gt;=C2=A0 (847) 69=
1-1404</div>
</div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--047d7bb03a9237194b0519df982f--

.


Author: Magnus Fromreide <magfr@lysator.liu.se>
Date: Thu, 2 Jul 2015 10:17:15 +0200
Raw View
On Wed, Jul 01, 2015 at 03:32:40PM -0400, Matthew Woehlke wrote:
> On 2015-07-01 15:20, Jim Porter wrote:
> > On 7/1/2015 1:07 PM, Arthur Tchaikovsky wrote:
> >> I propos safe switch . How it works? It works the way that it is
> >> *compiler error* if there are any fall-through cases.
> >
> > Given how long switch statements have been the way they are, I think
> > you'd stand a better chance of making forward progress if you talked to
> > compiler authors first, and added some extension that lets you indicate
> > when you wish to fall through. Then you have the safe code you want, and
> > if it got popular, you could try to standardize the existing practice of
> > using the explicit fallthrough.
> >
> > And hey, if it never got standardized, at least your code is still safe.
>
> You mean something like [[clang::fallthrough]]? I've suggested before
> standardizing [[fallthrough]]... unfortunately IIRC that got about the
> same reaction :-(.

In what paper?

When I asked if anyone had done that a while ago I was told nobody had tried
to propose only the fallthrough attribute without any changes to switch.

/MF

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: Matthew Woehlke <mwoehlke.floss@gmail.com>
Date: Thu, 02 Jul 2015 11:23:57 -0400
Raw View
On 2015-07-02 04:17, Magnus Fromreide wrote:
> On Wed, Jul 01, 2015 at 03:32:40PM -0400, Matthew Woehlke wrote:
>> On 2015-07-01 15:20, Jim Porter wrote:
>>> Given how long switch statements have been the way they are, I think
>>> you'd stand a better chance of making forward progress if you talked to
>>> compiler authors first, and added some extension that lets you indicate
>>> when you wish to fall through. Then you have the safe code you want, and
>>> if it got popular, you could try to standardize the existing practice of
>>> using the explicit fallthrough.
>>>
>>> And hey, if it never got standardized, at least your code is still safe.
>>
>> You mean something like [[clang::fallthrough]]? I've suggested before
>> standardizing [[fallthrough]]... unfortunately IIRC that got about the
>> same reaction :-(.
>
> In what paper?
>
> When I asked if anyone had done that a while ago I was told nobody had tried
> to propose only the fallthrough attribute without any changes to switch.

I said "suggested" (i.e. here), not "proposed" (i.e. paper). The
combination of expressed enthusiasm and my own "need" was not enough to
convince me (or anyone else, apparently) to pursue it to the formal stages.

Anyway, what's more important is getting GCC to support it in some form.
Standardization might help that, but isn't required; without GCC
supporting it (either by standardized or vendor-specific attribute),
there's no value added for me (unless I switch to clang, which already
supports it as a vendor-specific attribute).

--
Matthew

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: Arthur Tchaikovsky <atch.cpp@gmail.com>
Date: Thu, 2 Jul 2015 10:43:54 -0700 (PDT)
Raw View
------=_Part_805_193195903.1435859035022
Content-Type: multipart/alternative;
 boundary="----=_Part_806_48267457.1435859035023"

------=_Part_806_48267457.1435859035023
Content-Type: text/plain; charset=UTF-8

As with everything, things change with time, so asking after a period of
time if attitude to a concept changed is not a rude behavior, it is natural
and this cycle will repeat itself over and over.

But you have really unpleasant attitude. I'd appreciate if you never reply
to thread started by me.

Thank you, wish I never hear from you again.


On Thursday, 2 July 2015 08:43:27 UTC+1, Nevin ":-)" Liber wrote:
>
> On 2 July 2015 at 00:34, Arthur Tchaikovsky <atch...@gmail.com
> <javascript:>> wrote:
>
>>
>>
>> On Thursday, 2 July 2015 04:01:53 UTC+1, David Krauss wrote:
>>>
>>>
>>>
>>> Changing the behavior of switch is a fantasy. Change your own behavior
>>> instead.
>>>
>>> Another rude reply. And behavior. Unbelievable.
>>
>
> Some of us think it is rude to ask for opinions on something they already
> asked in the past.   And it isn't like this is the first time you've done
> it...
> --
>  Nevin ":-)" Liber  <mailto:ne...@eviloverlord.com <javascript:>>  (847)
> 691-1404
>

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_806_48267457.1435859035023
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">As with everything, things change with time, so asking aft=
er a period of time if attitude to a concept changed is not a rude behavior=
, it is natural and this cycle will repeat itself over and over. <br><br>Bu=
t you have really unpleasant attitude. I'd appreciate if you never reply to=
 thread started by me.<br><br>Thank you, wish I never hear from you again. =
<br>&nbsp;<br><br>On Thursday, 2 July 2015 08:43:27 UTC+1, Nevin ":-)" Libe=
r  wrote:<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">On 2=
 July 2015 at 00:34, Arthur Tchaikovsky <span dir=3D"ltr">&lt;<a href=3D"ja=
vascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"HHikNzx4s3MJ" rel=3D"=
nofollow" onmousedown=3D"this.href=3D'javascript:';return true;" onclick=3D=
"this.href=3D'javascript:';return true;">atch...@gmail.com</a>&gt;</span> w=
rote:<br><div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" =
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><di=
v dir=3D"ltr"><span><br><br>On Thursday, 2 July 2015 04:01:53 UTC+1, David =
Krauss  wrote:</span><span><blockquote class=3D"gmail_quote" style=3D"margi=
n:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div sty=
le=3D"word-wrap:break-word"><br><div><br></div><div>Changing the behavior o=
f <font face=3D"Courier">switch</font> is a fantasy. Change your own behavi=
or instead.</div><div><br></div></div></blockquote></span><div>Another rude=
 reply. And behavior. Unbelievable. <br></div></div></blockquote><div><br><=
/div><div>Some of us think it is rude to ask for opinions on something they=
 already asked in the past. &nbsp; And it isn't like this is the first time=
 you've done it...</div></div>-- <br><div>&nbsp;Nevin ":-)" Liber&nbsp; &lt=
;mailto:<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
HHikNzx4s3MJ" rel=3D"nofollow" onmousedown=3D"this.href=3D'javascript:';ret=
urn true;" onclick=3D"this.href=3D'javascript:';return true;">ne...@evilove=
rlord.com</a><wbr>&gt;&nbsp; (847) 691-1404</div>
</div></div>
</blockquote></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_806_48267457.1435859035023--
------=_Part_805_193195903.1435859035022--

.


Author: Nevin Liber <nevin@eviloverlord.com>
Date: Thu, 2 Jul 2015 10:56:56 -0700
Raw View
--047d7bb03a92a724810519e82cad
Content-Type: text/plain; charset=UTF-8

On 2 July 2015 at 10:43, Arthur Tchaikovsky <atch.cpp@gmail.com> wrote:

> As with everything, things change with time,
>

Really?  Has your "proposal" changed at all, or are you just repeating the
same old tired arguments?


> so asking after a period of time if attitude to a concept changed is not a
> rude behavior,
>

It is rude if you don't point out that you are doing so, hoping we forgot.
It makes me wonder if last time when you did this, did you really "forget"
that you were repeating yourself as you had claimed, or were you just
intentionally and deliberately misleading us?


> it is natural and this cycle will repeat itself over and over.
>
> But you have really unpleasant attitude. I'd appreciate if you never reply
> to thread started by me.
>
> Thank you, wish I never hear from you again.
>

Can't promise that.  If you ever actually make a real proposal (seems
doubtful, given your propensity to keep doing the same thing over and over
again, expecting a different result), I'm pretty sure you'll hear from me.
--
 Nevin ":-)" Liber  <mailto:nevin@eviloverlord.com>  (847) 691-1404

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--047d7bb03a92a724810519e82cad
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On 2 July 2015 at 10:43, Arthur Tchaikovsky <span dir=3D"l=
tr">&lt;<a href=3D"mailto:atch.cpp@gmail.com" target=3D"_blank">atch.cpp@gm=
ail.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"g=
mail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bo=
rder-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">As with everyth=
ing, things change with time,</div></blockquote><div><br></div><div>Really?=
=C2=A0 Has your &quot;proposal&quot; changed at all, or are you just repeat=
ing the same old tired arguments?</div><div>=C2=A0</div><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><div dir=3D"ltr"> so asking after a period of time if attitud=
e to a concept changed is not a rude behavior,</div></blockquote><div><br><=
/div><div>It is rude if you don&#39;t point out that you are doing so, hopi=
ng we forgot.=C2=A0 It makes me wonder if last time when you did this, did =
you really &quot;forget&quot; that you were repeating yourself as you had c=
laimed, or were you just intentionally and deliberately misleading us?</div=
><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .=
8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"> it is na=
tural and this cycle will repeat itself over and over. <br><br>But you have=
 really unpleasant attitude. I&#39;d appreciate if you never reply to threa=
d started by me.<br><br>Thank you, wish I never hear from you again. <br></=
div></blockquote><div><br></div><div>Can&#39;t promise that.=C2=A0 If you e=
ver actually make a real proposal (seems doubtful, given your propensity to=
 keep doing the same thing over and over again, expecting a different resul=
t), I&#39;m pretty sure you&#39;ll hear from me.</div></div>-- <br><div cla=
ss=3D"gmail_signature">=C2=A0Nevin &quot;:-)&quot; Liber=C2=A0 &lt;mailto:<=
a href=3D"mailto:nevin@eviloverlord.com" target=3D"_blank">nevin@eviloverlo=
rd.com</a>&gt;=C2=A0 (847) 691-1404</div>
</div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--047d7bb03a92a724810519e82cad--

.


Author: Arthur Tchaikovsky <atch.cpp@gmail.com>
Date: Thu, 2 Jul 2015 11:14:01 -0700 (PDT)
Raw View
------=_Part_789_245661594.1435860841285
Content-Type: multipart/alternative;
 boundary="----=_Part_790_1370840824.1435860841285"

------=_Part_790_1370840824.1435860841285
Content-Type: text/plain; charset=UTF-8

Now, that is rude, somebody tells you that he wishes not to hear from you,
yet you say that you don't respect that person wishes and will keep
talking. That's what I call rude behavior.

And as for proposals from me? No, I'll probably never even attempt to write
one, several reasons,
1) have to much practical work to do, can't spend endless months and weeks
arguing with rude/unimaginative people like you, who instead of providing
constructive feedback, you like a kid enjoy posting smart remarks and
comments. Example, instead of either don't post anything, or simply give
answer to my question, you like a spoiled brat, commented on very
irrelevant and off topic remark made by another "genius". What did you say?
Oh, yes, "some of us think that is rude...." - what this has to do with my
OP?

2) Don't wanna have anything to do with people like you.

On Thursday, 2 July 2015 18:57:38 UTC+1, Nevin ":-)" Liber wrote:
>
> On 2 July 2015 at 10:43, Arthur Tchaikovsky <atch...@gmail.com
> <javascript:>> wrote:
>
>> As with everything, things change with time,
>>
>
> Really?  Has your "proposal" changed at all, or are you just repeating the
> same old tired arguments?
>
>
>> so asking after a period of time if attitude to a concept changed is not
>> a rude behavior,
>>
>
> It is rude if you don't point out that you are doing so, hoping we
> forgot.  It makes me wonder if last time when you did this, did you really
> "forget" that you were repeating yourself as you had claimed, or were you
> just intentionally and deliberately misleading us?
>
>
>> it is natural and this cycle will repeat itself over and over.
>>
>> But you have really unpleasant attitude. I'd appreciate if you never
>> reply to thread started by me.
>>
>> Thank you, wish I never hear from you again.
>>
>
> Can't promise that.  If you ever actually make a real proposal (seems
> doubtful, given your propensity to keep doing the same thing over and over
> again, expecting a different result), I'm pretty sure you'll hear from me.
> --
>  Nevin ":-)" Liber  <mailto:ne...@eviloverlord.com <javascript:>>  (847)
> 691-1404
>

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_790_1370840824.1435860841285
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Now, that is rude, somebody tells you that he wishes not t=
o hear from you, yet you say that you don't respect that person wishes and =
will keep talking. That's what I call rude behavior. <br><br>And as for pro=
posals from me? No, I'll probably never even attempt to write one, several =
reasons,<br>1) have to much practical work to do, can't spend endless month=
s and weeks arguing with rude/unimaginative people like you, who instead of=
 providing constructive feedback, you like a kid enjoy posting smart remark=
s and comments. Example, instead of either don't post anything, or simply g=
ive answer to my question, you like a spoiled brat, commented on very irrel=
evant and off topic remark made by another "genius". What did you say? Oh, =
yes, "some of us think that is rude...." - what this has to do with my OP?<=
br><br>2) Don't wanna have anything to do with people like you. <br><br>On =
Thursday, 2 July 2015 18:57:38 UTC+1, Nevin ":-)" Liber  wrote:<blockquote =
class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1p=
x #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">On 2 July 2015 at 10:43, =
Arthur Tchaikovsky <span dir=3D"ltr">&lt;<a href=3D"javascript:" target=3D"=
_blank" gdf-obfuscated-mailto=3D"o6HIPBLKLJkJ" rel=3D"nofollow" onmousedown=
=3D"this.href=3D'javascript:';return true;" onclick=3D"this.href=3D'javascr=
ipt:';return true;">atch...@gmail.com</a>&gt;</span> wrote:<br><div><div cl=
ass=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0=
 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">As with=
 everything, things change with time,</div></blockquote><div><br></div><div=
>Really?&nbsp; Has your "proposal" changed at all, or are you just repeatin=
g the same old tired arguments?</div><div>&nbsp;</div><blockquote class=3D"=
gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-=
left:1ex"><div dir=3D"ltr"> so asking after a period of time if attitude to=
 a concept changed is not a rude behavior,</div></blockquote><div><br></div=
><div>It is rude if you don't point out that you are doing so, hoping we fo=
rgot.&nbsp; It makes me wonder if last time when you did this, did you real=
ly "forget" that you were repeating yourself as you had claimed, or were yo=
u just intentionally and deliberately misleading us?</div><div>&nbsp;</div>=
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"> it is natural and this cyc=
le will repeat itself over and over. <br><br>But you have really unpleasant=
 attitude. I'd appreciate if you never reply to thread started by me.<br><b=
r>Thank you, wish I never hear from you again. <br></div></blockquote><div>=
<br></div><div>Can't promise that.&nbsp; If you ever actually make a real p=
roposal (seems doubtful, given your propensity to keep doing the same thing=
 over and over again, expecting a different result), I'm pretty sure you'll=
 hear from me.</div></div>-- <br><div>&nbsp;Nevin ":-)" Liber&nbsp; &lt;mai=
lto:<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"o6HI=
PBLKLJkJ" rel=3D"nofollow" onmousedown=3D"this.href=3D'javascript:';return =
true;" onclick=3D"this.href=3D'javascript:';return true;">ne...@eviloverlor=
d.com</a><wbr>&gt;&nbsp; (847) 691-1404</div>
</div></div>
</blockquote></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_790_1370840824.1435860841285--
------=_Part_789_245661594.1435860841285--

.


Author: Arthur Tchaikovsky <atch.cpp@gmail.com>
Date: Thu, 2 Jul 2015 11:16:00 -0700 (PDT)
Raw View
------=_Part_3626_202263258.1435860960628
Content-Type: multipart/alternative;
 boundary="----=_Part_3627_2119447652.1435860960628"

------=_Part_3627_2119447652.1435860960628
Content-Type: text/plain; charset=UTF-8



On Thursday, 2 July 2015 18:57:38 UTC+1, Nevin ":-)" Liber wrote:
>
>
>
> It is rude if you don't point out that you are doing so, hoping we
> forgot.  It makes me wonder if last time when you did this, did you really
> "forget" that you were repeating yourself as you had claimed, or were you
> just intentionally and deliberately misleading us?
>

^^^This is assumption, made by you. I never meant to mislead anyone, nor I
hoped that you forgot. Making assumptions is really nasty and unpleasant
trait.

>
>

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_3627_2119447652.1435860960628
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Thursday, 2 July 2015 18:57:38 UTC+1, Nevin ":-=
)" Liber  wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin=
-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"lt=
r"><div dir=3D"ltr"><br></div><div><div class=3D"gmail_quote"><div><br></di=
v><div>It is rude if you don't point out that you are doing so, hoping we f=
orgot.&nbsp; It makes me wonder if last time when you did this, did you rea=
lly "forget" that you were repeating yourself as you had claimed, or were y=
ou just intentionally and deliberately misleading us?</div><div></div></div=
></div></div></blockquote><div><br>^^^This is assumption, made by you. I ne=
ver meant to mislead anyone, nor I hoped that you forgot. Making assumption=
s is really nasty and unpleasant trait.<br></div><blockquote class=3D"gmail=
_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;p=
adding-left: 1ex;"><div dir=3D"ltr"><div><div class=3D"gmail_quote"><div>&n=
bsp;</div></div></div></div>
</blockquote></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_3627_2119447652.1435860960628--
------=_Part_3626_202263258.1435860960628--

.


Author: =?UTF-8?Q?Daniel_Kr=C3=BCgler?= <daniel.kruegler@gmail.com>
Date: Thu, 2 Jul 2015 21:07:08 +0200
Raw View
2015-07-02 20:14 GMT+02:00 Arthur Tchaikovsky <atch.cpp@gmail.com>:
> Now, that is rude, somebody tells you that he wishes not to hear from you,
> yet you say that you don't respect that person wishes and will keep talking.
> That's what I call rude behavior.

Please calm down. This is a public forum and you really cannot forbid
someone else to contribute to that forum.

> And as for proposals from me? No, I'll probably never even attempt to write
> one, several reasons,
> 1) have to much practical work to do, can't spend endless months and weeks
> arguing with rude/unimaginative people like you, who instead of providing
> constructive feedback, you like a kid enjoy posting smart remarks and
> comments. Example, instead of either don't post anything, or simply give
> answer to my question, you like a spoiled brat, commented on very irrelevant
> and off topic remark made by another "genius". What did you say? Oh, yes,
> "some of us think that is rude...." - what this has to do with my OP?

Yes, there is one thing, that you really should provide, if you want
to make contributions to the C++ standard: Time and patience. Often
not everyone will agree with you. That is normal for a review-based
procedure. In general you cannot expect, that you write a ten-line
sketch of an idea to this forum and that this will be wholeheartedly
embraced as given. If people express counter positions or scrutinize,
that doesn't mean that they are rude or unimaginative. It also doesn't
mean that your proposal is bad, maybe you need to improve the way of
how you explained to us? You do not necessary need to share their
views, but please don't assault those who do not share your view of
being bad people, so to say. You really should try to listen to them
and try to make your proposal more agreeable. If you have a brilliant
idea but that would change the language in such a drastic way as your
original suggestion seemed to imply, it is often better to start first
with a less radical proposal that provides a genius new feature, and
when this gets good feedback, there are good chances that once that
would be accepted, less nice language features could get deprecated.
Yes, there are a lot of conjunctives in my last sentences, but that is
how trying to change a Standard works.

Finally, let me please just express the following honest personal
recommendation: I do know Nevin since years, and I really can ensure
you, that it is wise to listen to his opinion.

> 2) Don't wanna have anything to do with people like you.

I'm sorry for your unhappiness that you felt to have experienced, but
in this case, I really see no cure that would still be productive for
C++.

Sincerely,

- Daniel

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: Tony V E <tvaneerd@gmail.com>
Date: Thu, 2 Jul 2015 15:57:10 -0400
Raw View
--001a11c3fd125441d70519e9d880
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Instead of trying to fix switch, I suspect we should work towards
patterning matching of some kind, which can then replace switch completely,
almost as a side effect.

In fact Bjarne is working on it, with Yuriy Solodkyy and Gabriel Dos Reis.
See, for example, http://www.stroustrup.com/OpenPatternMatching.pdf (the
PDF shows it done with macros and other scariness - to show that it is
possible - but they are now working on how it might be added to the
language.)

Please leave switch alone, it has been shown to be a waste of time.  But
feel free to help on pattern matching; or have faith in Bjarne et al to
figure it out.

Tony


On Thu, Jul 2, 2015 at 3:07 PM, Daniel Kr=C3=BCgler <daniel.kruegler@gmail.=
com>
wrote:

> 2015-07-02 20:14 GMT+02:00 Arthur Tchaikovsky <atch.cpp@gmail.com>:
> > Now, that is rude, somebody tells you that he wishes not to hear from
> you,
> > yet you say that you don't respect that person wishes and will keep
> talking.
> > That's what I call rude behavior.
>
> Please calm down. This is a public forum and you really cannot forbid
> someone else to contribute to that forum.
>
> > And as for proposals from me? No, I'll probably never even attempt to
> write
> > one, several reasons,
> > 1) have to much practical work to do, can't spend endless months and
> weeks
> > arguing with rude/unimaginative people like you, who instead of providi=
ng
> > constructive feedback, you like a kid enjoy posting smart remarks and
> > comments. Example, instead of either don't post anything, or simply giv=
e
> > answer to my question, you like a spoiled brat, commented on very
> irrelevant
> > and off topic remark made by another "genius". What did you say? Oh, ye=
s,
> > "some of us think that is rude...." - what this has to do with my OP?
>
> Yes, there is one thing, that you really should provide, if you want
> to make contributions to the C++ standard: Time and patience. Often
> not everyone will agree with you. That is normal for a review-based
> procedure. In general you cannot expect, that you write a ten-line
> sketch of an idea to this forum and that this will be wholeheartedly
> embraced as given. If people express counter positions or scrutinize,
> that doesn't mean that they are rude or unimaginative. It also doesn't
> mean that your proposal is bad, maybe you need to improve the way of
> how you explained to us? You do not necessary need to share their
> views, but please don't assault those who do not share your view of
> being bad people, so to say. You really should try to listen to them
> and try to make your proposal more agreeable. If you have a brilliant
> idea but that would change the language in such a drastic way as your
> original suggestion seemed to imply, it is often better to start first
> with a less radical proposal that provides a genius new feature, and
> when this gets good feedback, there are good chances that once that
> would be accepted, less nice language features could get deprecated.
> Yes, there are a lot of conjunctives in my last sentences, but that is
> how trying to change a Standard works.
>
> Finally, let me please just express the following honest personal
> recommendation: I do know Nevin since years, and I really can ensure
> you, that it is wise to listen to his opinion.
>
> > 2) Don't wanna have anything to do with people like you.
>
> I'm sorry for your unhappiness that you felt to have experienced, but
> in this case, I really see no cure that would still be productive for
> C++.
>
> Sincerely,
>
> - Daniel
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>

--=20

---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--001a11c3fd125441d70519e9d880
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div>Instead of trying to fix switch, I suspect we sh=
ould work towards patterning matching of some kind, which can then replace =
switch completely, almost as a side effect.<br><br></div>In fact Bjarne is =
working on it, with Yuriy Solodkyy and Gabriel Dos Reis.=C2=A0 See, for exa=
mple, <a href=3D"http://www.stroustrup.com/OpenPatternMatching.pdf">http://=
www.stroustrup.com/OpenPatternMatching.pdf</a> (the PDF shows it done with =
macros and other scariness - to show that it is possible - but they are now=
 working on how it might be added to the language.)<br><br></div><div>Pleas=
e leave switch alone, it has been shown to be a waste of time.=C2=A0 But fe=
el free to help on pattern matching; or have faith in Bjarne et al to figur=
e it out.<br><br></div><div>Tony<br><br></div></div><div class=3D"gmail_ext=
ra"><br><div class=3D"gmail_quote">On Thu, Jul 2, 2015 at 3:07 PM, Daniel K=
r=C3=BCgler <span dir=3D"ltr">&lt;<a href=3D"mailto:daniel.kruegler@gmail.c=
om" target=3D"_blank">daniel.kruegler@gmail.com</a>&gt;</span> wrote:<br><b=
lockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px =
#ccc solid;padding-left:1ex"><span class=3D"">2015-07-02 20:14 GMT+02:00 Ar=
thur Tchaikovsky &lt;<a href=3D"mailto:atch.cpp@gmail.com">atch.cpp@gmail.c=
om</a>&gt;:<br>
&gt; Now, that is rude, somebody tells you that he wishes not to hear from =
you,<br>
&gt; yet you say that you don&#39;t respect that person wishes and will kee=
p talking.<br>
&gt; That&#39;s what I call rude behavior.<br>
<br>
</span>Please calm down. This is a public forum and you really cannot forbi=
d<br>
someone else to contribute to that forum.<br>
<span class=3D""><br>
&gt; And as for proposals from me? No, I&#39;ll probably never even attempt=
 to write<br>
&gt; one, several reasons,<br>
&gt; 1) have to much practical work to do, can&#39;t spend endless months a=
nd weeks<br>
&gt; arguing with rude/unimaginative people like you, who instead of provid=
ing<br>
&gt; constructive feedback, you like a kid enjoy posting smart remarks and<=
br>
&gt; comments. Example, instead of either don&#39;t post anything, or simpl=
y give<br>
&gt; answer to my question, you like a spoiled brat, commented on very irre=
levant<br>
&gt; and off topic remark made by another &quot;genius&quot;. What did you =
say? Oh, yes,<br>
&gt; &quot;some of us think that is rude....&quot; - what this has to do wi=
th my OP?<br>
<br>
</span>Yes, there is one thing, that you really should provide, if you want=
<br>
to make contributions to the C++ standard: Time and patience. Often<br>
not everyone will agree with you. That is normal for a review-based<br>
procedure. In general you cannot expect, that you write a ten-line<br>
sketch of an idea to this forum and that this will be wholeheartedly<br>
embraced as given. If people express counter positions or scrutinize,<br>
that doesn&#39;t mean that they are rude or unimaginative. It also doesn&#3=
9;t<br>
mean that your proposal is bad, maybe you need to improve the way of<br>
how you explained to us? You do not necessary need to share their<br>
views, but please don&#39;t assault those who do not share your view of<br>
being bad people, so to say. You really should try to listen to them<br>
and try to make your proposal more agreeable. If you have a brilliant<br>
idea but that would change the language in such a drastic way as your<br>
original suggestion seemed to imply, it is often better to start first<br>
with a less radical proposal that provides a genius new feature, and<br>
when this gets good feedback, there are good chances that once that<br>
would be accepted, less nice language features could get deprecated.<br>
Yes, there are a lot of conjunctives in my last sentences, but that is<br>
how trying to change a Standard works.<br>
<br>
Finally, let me please just express the following honest personal<br>
recommendation: I do know Nevin since years, and I really can ensure<br>
you, that it is wise to listen to his opinion.<br>
<span class=3D""><br>
&gt; 2) Don&#39;t wanna have anything to do with people like you.<br>
<br>
</span>I&#39;m sorry for your unhappiness that you felt to have experienced=
, but<br>
in this case, I really see no cure that would still be productive for<br>
C++.<br>
<br>
Sincerely,<br>
<br>
- Daniel<br>
<div class=3D"HOEnZb"><div class=3D"h5"><br>
--<br>
<br>
---<br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org">std-propo=
sals+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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" rel=3D"noreferrer" target=3D"_blank">http://groups.google.c=
om/a/isocpp.org/group/std-proposals/</a>.<br>
</div></div></blockquote></div><br></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a11c3fd125441d70519e9d880--

.


Author: Patrice Roy <patricer@gmail.com>
Date: Thu, 2 Jul 2015 19:31:02 -0400
Raw View
--001a113438322dc9e80519ecd5e7
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

+1 Tony. Pattern matching we need, indeed. That probably explains, at least
in part, all the discussions around the variant proposal.

2015-07-02 15:57 GMT-04:00 Tony V E <tvaneerd@gmail.com>:

> Instead of trying to fix switch, I suspect we should work towards
> patterning matching of some kind, which can then replace switch completel=
y,
> almost as a side effect.
>
> In fact Bjarne is working on it, with Yuriy Solodkyy and Gabriel Dos
> Reis.  See, for example, http://www.stroustrup.com/OpenPatternMatching.pd=
f
> (the PDF shows it done with macros and other scariness - to show that it =
is
> possible - but they are now working on how it might be added to the
> language.)
>
> Please leave switch alone, it has been shown to be a waste of time.  But
> feel free to help on pattern matching; or have faith in Bjarne et al to
> figure it out.
>
> Tony
>
>
> On Thu, Jul 2, 2015 at 3:07 PM, Daniel Kr=C3=BCgler <daniel.kruegler@gmai=
l.com>
> wrote:
>
>> 2015-07-02 20:14 GMT+02:00 Arthur Tchaikovsky <atch.cpp@gmail.com>:
>> > Now, that is rude, somebody tells you that he wishes not to hear from
>> you,
>> > yet you say that you don't respect that person wishes and will keep
>> talking.
>> > That's what I call rude behavior.
>>
>> Please calm down. This is a public forum and you really cannot forbid
>> someone else to contribute to that forum.
>>
>> > And as for proposals from me? No, I'll probably never even attempt to
>> write
>> > one, several reasons,
>> > 1) have to much practical work to do, can't spend endless months and
>> weeks
>> > arguing with rude/unimaginative people like you, who instead of
>> providing
>> > constructive feedback, you like a kid enjoy posting smart remarks and
>> > comments. Example, instead of either don't post anything, or simply gi=
ve
>> > answer to my question, you like a spoiled brat, commented on very
>> irrelevant
>> > and off topic remark made by another "genius". What did you say? Oh,
>> yes,
>> > "some of us think that is rude...." - what this has to do with my OP?
>>
>> Yes, there is one thing, that you really should provide, if you want
>> to make contributions to the C++ standard: Time and patience. Often
>> not everyone will agree with you. That is normal for a review-based
>> procedure. In general you cannot expect, that you write a ten-line
>> sketch of an idea to this forum and that this will be wholeheartedly
>> embraced as given. If people express counter positions or scrutinize,
>> that doesn't mean that they are rude or unimaginative. It also doesn't
>> mean that your proposal is bad, maybe you need to improve the way of
>> how you explained to us? You do not necessary need to share their
>> views, but please don't assault those who do not share your view of
>> being bad people, so to say. You really should try to listen to them
>> and try to make your proposal more agreeable. If you have a brilliant
>> idea but that would change the language in such a drastic way as your
>> original suggestion seemed to imply, it is often better to start first
>> with a less radical proposal that provides a genius new feature, and
>> when this gets good feedback, there are good chances that once that
>> would be accepted, less nice language features could get deprecated.
>> Yes, there are a lot of conjunctives in my last sentences, but that is
>> how trying to change a Standard works.
>>
>> Finally, let me please just express the following honest personal
>> recommendation: I do know Nevin since years, and I really can ensure
>> you, that it is wise to listen to his opinion.
>>
>> > 2) Don't wanna have anything to do with people like you.
>>
>> I'm sorry for your unhappiness that you felt to have experienced, but
>> in this case, I really see no cure that would still be productive for
>> C++.
>>
>> Sincerely,
>>
>> - Daniel
>>
>> --
>>
>> ---
>> You received this message because you are subscribed to the Google Group=
s
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> email to std-proposals+unsubscribe@isocpp.org.
>> To post to this group, send email to std-proposals@isocpp.org.
>> Visit this group at
>> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>>
>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>

--=20

---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--001a113438322dc9e80519ecd5e7
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">+1 Tony. Pattern matching we need, indeed. That probably e=
xplains, at least in part, all the discussions around the variant proposal.=
<br></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">2015-07=
-02 15:57 GMT-04:00 Tony V E <span dir=3D"ltr">&lt;<a href=3D"mailto:tvanee=
rd@gmail.com" target=3D"_blank">tvaneerd@gmail.com</a>&gt;</span>:<br><bloc=
kquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #cc=
c solid;padding-left:1ex"><div dir=3D"ltr"><div><div>Instead of trying to f=
ix switch, I suspect we should work towards patterning matching of some kin=
d, which can then replace switch completely, almost as a side effect.<br><b=
r></div>In fact Bjarne is working on it, with Yuriy Solodkyy and Gabriel Do=
s Reis.=C2=A0 See, for example, <a href=3D"http://www.stroustrup.com/OpenPa=
tternMatching.pdf" target=3D"_blank">http://www.stroustrup.com/OpenPatternM=
atching.pdf</a> (the PDF shows it done with macros and other scariness - to=
 show that it is possible - but they are now working on how it might be add=
ed to the language.)<br><br></div><div>Please leave switch alone, it has be=
en shown to be a waste of time.=C2=A0 But feel free to help on pattern matc=
hing; or have faith in Bjarne et al to figure it out.<span class=3D"HOEnZb"=
><font color=3D"#888888"><br><br></font></span></div><span class=3D"HOEnZb"=
><font color=3D"#888888"><div>Tony<br><br></div></font></span></div><div cl=
ass=3D"HOEnZb"><div class=3D"h5"><div class=3D"gmail_extra"><br><div class=
=3D"gmail_quote">On Thu, Jul 2, 2015 at 3:07 PM, Daniel Kr=C3=BCgler <span =
dir=3D"ltr">&lt;<a href=3D"mailto:daniel.kruegler@gmail.com" target=3D"_bla=
nk">daniel.kruegler@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D=
"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding=
-left:1ex"><span>2015-07-02 20:14 GMT+02:00 Arthur Tchaikovsky &lt;<a href=
=3D"mailto:atch.cpp@gmail.com" target=3D"_blank">atch.cpp@gmail.com</a>&gt;=
:<br>
&gt; Now, that is rude, somebody tells you that he wishes not to hear from =
you,<br>
&gt; yet you say that you don&#39;t respect that person wishes and will kee=
p talking.<br>
&gt; That&#39;s what I call rude behavior.<br>
<br>
</span>Please calm down. This is a public forum and you really cannot forbi=
d<br>
someone else to contribute to that forum.<br>
<span><br>
&gt; And as for proposals from me? No, I&#39;ll probably never even attempt=
 to write<br>
&gt; one, several reasons,<br>
&gt; 1) have to much practical work to do, can&#39;t spend endless months a=
nd weeks<br>
&gt; arguing with rude/unimaginative people like you, who instead of provid=
ing<br>
&gt; constructive feedback, you like a kid enjoy posting smart remarks and<=
br>
&gt; comments. Example, instead of either don&#39;t post anything, or simpl=
y give<br>
&gt; answer to my question, you like a spoiled brat, commented on very irre=
levant<br>
&gt; and off topic remark made by another &quot;genius&quot;. What did you =
say? Oh, yes,<br>
&gt; &quot;some of us think that is rude....&quot; - what this has to do wi=
th my OP?<br>
<br>
</span>Yes, there is one thing, that you really should provide, if you want=
<br>
to make contributions to the C++ standard: Time and patience. Often<br>
not everyone will agree with you. That is normal for a review-based<br>
procedure. In general you cannot expect, that you write a ten-line<br>
sketch of an idea to this forum and that this will be wholeheartedly<br>
embraced as given. If people express counter positions or scrutinize,<br>
that doesn&#39;t mean that they are rude or unimaginative. It also doesn&#3=
9;t<br>
mean that your proposal is bad, maybe you need to improve the way of<br>
how you explained to us? You do not necessary need to share their<br>
views, but please don&#39;t assault those who do not share your view of<br>
being bad people, so to say. You really should try to listen to them<br>
and try to make your proposal more agreeable. If you have a brilliant<br>
idea but that would change the language in such a drastic way as your<br>
original suggestion seemed to imply, it is often better to start first<br>
with a less radical proposal that provides a genius new feature, and<br>
when this gets good feedback, there are good chances that once that<br>
would be accepted, less nice language features could get deprecated.<br>
Yes, there are a lot of conjunctives in my last sentences, but that is<br>
how trying to change a Standard works.<br>
<br>
Finally, let me please just express the following honest personal<br>
recommendation: I do know Nevin since years, and I really can ensure<br>
you, that it is wise to listen to his opinion.<br>
<span><br>
&gt; 2) Don&#39;t wanna have anything to do with people like you.<br>
<br>
</span>I&#39;m sorry for your unhappiness that you felt to have experienced=
, but<br>
in this case, I really see no cure that would still be productive for<br>
C++.<br>
<br>
Sincerely,<br>
<br>
- Daniel<br>
<div><div><br>
--<br>
<br>
---<br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" rel=3D"noreferrer" target=3D"_blank">http://groups.google.c=
om/a/isocpp.org/group/std-proposals/</a>.<br>
</div></div></blockquote></div><br></div>

<p></p>

-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a113438322dc9e80519ecd5e7--

.


Author: David Krauss <potswa@gmail.com>
Date: Fri, 3 Jul 2015 10:16:20 +0800
Raw View
--Apple-Mail=_60C4A97D-A624-40D0-8647-9FB6A9F228D3
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8

Pattern matching is a powerful technique, one of the things that makes the =
Haskell language so popular.

Variants are a nice handle to the visitor pattern. C++ will be better when =
type-based dispatching doesn=E2=80=99t require writing virtual functions lo=
nghand.

But a safe version of switch is low-hanging fruit. It=E2=80=99s available t=
oday to anyone who wants it.

I created my safe switch library <https://github.com/potswa/safe_switch> in=
 one day, yet it=E2=80=99s intended to do the job as well as can be done. S=
till, it=E2=80=99s not =E2=80=9Csexy,=E2=80=9D and I don=E2=80=99t expect m=
uch interest because it=E2=80=99s not very interesting. Low interest leads =
to low adoption. This is unfortunate, though, because the right tool for th=
e job is usually the simplest one.


> On 2015=E2=80=9307=E2=80=9303, at 7:31 AM, Patrice Roy <patricer@gmail.co=
m> wrote:
>=20
> +1 Tony. Pattern matching we need, indeed. That probably explains, at lea=
st in part, all the discussions around the variant proposal.
>=20
> 2015-07-02 15:57 GMT-04:00 Tony V E <tvaneerd@gmail.com <mailto:tvaneerd@=
gmail.com>>:
> Instead of trying to fix switch, I suspect we should work towards pattern=
ing matching of some kind, which can then replace switch completely, almost=
 as a side effect.
>=20
> In fact Bjarne is working on it, with Yuriy Solodkyy and Gabriel Dos Reis=
..  See, for example, http://www.stroustrup.com/OpenPatternMatching.pdf <htt=
p://www.stroustrup.com/OpenPatternMatching.pdf> (the PDF shows it done with=
 macros and other scariness - to show that it is possible - but they are no=
w working on how it might be added to the language.)

Yes, that=E2=80=99s the Mach7 library I mentioned earlier. I=E2=80=99ve not=
 reviewed the internals in detail (it=E2=80=99s crazy complicated), but jud=
ging by the paper and the gist of the macros, switch fallthroughs are the k=
ey to its performance enhancement.

Scary and unsafe things like labeled statements (i.e., switch and goto) are=
 still important to the language. They=E2=80=99re unsuitable for common use=
 but important for infrastructure. They make intrinsically scary and tricky=
 things less scary and more maintainable. The author of Mach7 is a mere mor=
tal, and certainly concerned with maintainability. Maybe even in his nightm=
ares.

On the other hand, things which get deprecated like auto, register, and aut=
o_ptr really don=E2=80=99t have any remaining uses. Outliers like strstream=
 and vector<bool> fall in between: still capable of adding value in extreme=
 cases, but unsuitably clever for what they do.

Back to what I was saying, programmers have an attraction to cleverness whi=
ch can lead to unnecessary headaches.

> Please leave switch alone, it has been shown to be a waste of time.  But =
feel free to help on pattern matching; or have faith in Bjarne et al to fig=
ure it out.


--=20

---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--Apple-Mail=_60C4A97D-A624-40D0-8647-9FB6A9F228D3
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D"">Pattern matching i=
s a powerful technique, one of the things that makes the Haskell language s=
o popular.<div class=3D""><br class=3D""></div><div class=3D"">Variants are=
 a nice handle to the visitor pattern. C++ will be better when type-based d=
ispatching doesn=E2=80=99t require writing virtual functions longhand.</div=
><div class=3D""><br class=3D""></div><div class=3D"">But a safe version of=
 <font face=3D"Courier" class=3D"">switch</font> is low-hanging fruit. It=
=E2=80=99s available today to anyone who wants it.</div><div class=3D""><br=
 class=3D""></div><div class=3D"">I created&nbsp;<a href=3D"https://github.=
com/potswa/safe_switch" class=3D"">my safe switch library</a>&nbsp;in one d=
ay, yet it=E2=80=99s intended to do the job as well as can be done. Still, =
it=E2=80=99s not =E2=80=9Csexy,=E2=80=9D and I don=E2=80=99t expect much in=
terest because it=E2=80=99s not very interesting. Low interest leads to low=
 adoption. This is unfortunate, though, because the right tool for the job =
is usually the simplest one.</div><div class=3D""><br class=3D""><div class=
=3D""><br class=3D""><div><blockquote type=3D"cite" class=3D""><div class=
=3D"">On 2015=E2=80=9307=E2=80=9303, at 7:31 AM, Patrice Roy &lt;<a href=3D=
"mailto:patricer@gmail.com" class=3D"">patricer@gmail.com</a>&gt; wrote:</d=
iv><br class=3D"Apple-interchange-newline"><div class=3D""><div dir=3D"ltr"=
 class=3D"">+1 Tony. Pattern matching we need, indeed. That probably explai=
ns, at least in part, all the discussions around the variant proposal.<br c=
lass=3D""></div><div class=3D"gmail_extra"><br class=3D""><div class=3D"gma=
il_quote">2015-07-02 15:57 GMT-04:00 Tony V E <span dir=3D"ltr" class=3D"">=
&lt;<a href=3D"mailto:tvaneerd@gmail.com" target=3D"_blank" class=3D"">tvan=
eerd@gmail.com</a>&gt;</span>:<br class=3D""><blockquote class=3D"gmail_quo=
te" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"=
><div dir=3D"ltr" class=3D""><div class=3D""><div class=3D"">Instead of try=
ing to fix switch, I suspect we should work towards patterning matching of =
some kind, which can then replace switch completely, almost as a side effec=
t.<br class=3D""><br class=3D""></div>In fact Bjarne is working on it, with=
 Yuriy Solodkyy and Gabriel Dos Reis.&nbsp; See, for example, <a href=3D"ht=
tp://www.stroustrup.com/OpenPatternMatching.pdf" target=3D"_blank" class=3D=
"">http://www.stroustrup.com/OpenPatternMatching.pdf</a> (the PDF shows it =
done with macros and other scariness - to show that it is possible - but th=
ey are now working on how it might be added to the language.)<br class=3D""=
></div></div></blockquote></div></div></div></blockquote><div><br class=3D"=
"></div><div>Yes, that=E2=80=99s the Mach7 library I mentioned earlier. I=
=E2=80=99ve not reviewed the internals in detail (it=E2=80=99s crazy compli=
cated), but judging by the paper and the gist of the macros, <font face=3D"=
Courier" class=3D"">switch</font> fallthroughs are the key to its performan=
ce enhancement.</div><div><br class=3D""></div><div>Scary and unsafe things=
 like labeled statements (i.e.,&nbsp;<font face=3D"Courier" class=3D"">swit=
ch</font> and <font face=3D"Courier" class=3D"">goto</font>) are still impo=
rtant to the language. They=E2=80=99re unsuitable for common use but import=
ant for infrastructure. They make intrinsically scary and tricky things les=
s scary and more maintainable. The author of Mach7 is a mere mortal, and ce=
rtainly concerned with maintainability. Maybe even in his nightmares.</div>=
<div><br class=3D""></div><div>On the other hand, things which get deprecat=
ed like <font face=3D"Courier" class=3D"">auto</font>, <font face=3D"Courie=
r" class=3D"">register</font>, and <font face=3D"Courier" class=3D"">auto_p=
tr</font>&nbsp;really don=E2=80=99t have any remaining uses. Outliers like =
<font face=3D"Courier" class=3D"">strstream</font>&nbsp;and <font face=3D"C=
ourier" class=3D"">vector&lt;bool&gt;</font> fall in between: still capable=
 of adding value in extreme cases, but unsuitably clever for what they do.<=
/div><div><br class=3D""></div><div>Back to what I was saying, programmers =
have an attraction to cleverness which can lead to unnecessary headaches.</=
div><br class=3D""><blockquote type=3D"cite" class=3D""><div class=3D""><di=
v class=3D"gmail_extra"><div class=3D"gmail_quote"><blockquote class=3D"gma=
il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef=
t:1ex"><div dir=3D"ltr" class=3D""><div class=3D"">Please leave switch alon=
e, it has been shown to be a waste of time.&nbsp; But feel free to help on =
pattern matching; or have faith in Bjarne et al to figure it out.<span clas=
s=3D"HOEnZb"><font color=3D"#888888" class=3D""><br class=3D""></font></spa=
n></div></div></blockquote></div></div></div></blockquote></div></div></div=
><div class=3D""><br class=3D""></div></body></html>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--Apple-Mail=_60C4A97D-A624-40D0-8647-9FB6A9F228D3--

.