220 33770 <CAOHCbisUO1-rHoSrFK-qc76OFxPsVx3NJOnyV6vb1WFDcwQ-NA@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Tony V E <tvaneerd@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: A more advanced switch
Date: Wed, 9 Aug 2017 22:45:24 -0400
Lines: 192
Approved: news@gmane.org
Message-ID: <CAOHCbisUO1-rHoSrFK-qc76OFxPsVx3NJOnyV6vb1WFDcwQ-NA@mail.gmail.com>
References: <f8c908e2-d06f-4cd1-bda0-fe2b97fd21f1@isocpp.org>
 <574320af-c1ae-4676-883c-ae4e91fcd874@isocpp.org> <CAOHCbisLgTxLz75Em3Had35AecQrtpRZKFWRaMXUZsSVtN7Fng@mail.gmail.com>
 <bffc4188-593d-426e-bf4c-01c6a2952087@isocpp.org> <omgg26$pob$1@blaine.gmane.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="001a113d3aac4008d805565d3086"
X-Trace: blaine.gmane.org 1502333129 30143 195.159.176.226 (10 Aug 2017 02:45:29 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 10 Aug 2017 02:45:29 +0000 (UTC)
To: Standard Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCUZ5QWKNQIMLENPZQCRUBHFEPH7Y@isocpp.org Thu Aug 10 04:45:22 2017
Return-path: <std-proposals+bncBCUZ5QWKNQIMLENPZQCRUBHFEPH7Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pg0-f71.google.com ([74.125.83.71])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCUZ5QWKNQIMLENPZQCRUBHFEPH7Y@isocpp.org>)
	id 1dfdTM-0007NM-RB
	for gclcip-std-proposals@m.gmane.org; Thu, 10 Aug 2017 04:45:21 +0200
Original-Received: by mail-pg0-f71.google.com with SMTP id 83sf82987030pgb.14
        for <gclcip-std-proposals@m.gmane.org>; Wed, 09 Aug 2017 19:45:27 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1502333126; cv=pass;
        d=google.com; s=arc-20160816;
        b=lOE4k66uWOqQdAzwV0usKXYHiwRHv6soux/xFqgrbhowlT2LdfJC/wC7tpOeN5W6j7
         bKE0rBtzLBQONrQN0gHFO5nykdh0Ka3cZ2yJ9HXUcstZbBCx/9AtngZiW3V0hF7RsDl6
         QfEzm/bExka982Y+tMJePyrIEPW198YnptLEruKPR7ixt4wUUwwZSOxpVDsVSWqCCS43
         tV0SLlh/XgZhxcFtAHStmDos+B5qfPfSFtEDavwGtf+EUbVnijoAJbTc/KZGSL7kdl4w
         RpwJRgVxbvXi+/vwZPVWY+TgGxGJL1K05x/v/XYaLFfJ8GyAA7lPFTEgqW8gvdtvnbIN
         HMSQ==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date
         :from:references:in-reply-to:mime-version:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=CUKTAOE0xwnV4R2pyXDQEwdwf22uiLewLTTbz1R0bPM=;
        b=oO8nbD7Uj/S5IGxsx4y7UCu/sZKTAWl26e1HtfDmrosMSBj2Ow6H6YXCgKGFY2W32h
         XibRnoVAIBF11DbUbhm9q5i7esLgusvX8Dr/ZRU4gWe+oex1LzJ+uJZ5tIaKhHS8KkJM
         vy7U+hWK2tK1/expkW7P9J+wmO4EvCaGV4VsjLTZXbF0N/Pjgs06V19eunDYcwfddlIz
         cGL6mloHMfLmFVPBfL0e6PviW/mQ5IOLW31MqHT29OznG4Rhxbko4WTivP+gdOBOHWb8
         Nq6Jpc9tBNvKGTduMIYjDyxg8RZfSsNQQofnxE0A0na3Z8xxkf6tPBI+i2box5oyrq9X
         rp/A==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=vgNwZED8;
       spf=pass (google.com: domain of tvaneerd@gmail.com designates 2607:f8b0:400d:c0d::232 as permitted sender) smtp.mailfrom=tvaneerd@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=CUKTAOE0xwnV4R2pyXDQEwdwf22uiLewLTTbz1R0bPM=;
        b=yQ7//KMmrGfsCGfWip054TU0jbE/NTrVXkc/tQVYFrFZtwV7wxKuqLt1BN1Ide0ZaG
         lXRL+mNst1Bel+P1vuYYKtcy/TKkKdtTL88yvI06DbDM5GNKDnv0DvFbe58x47jXOfS4
         QRJntlN+WUvgoekTFmXqDGEtGP3qx+AjJcWJBnaiilwmmS/RN0/LdDg/ErLayq7UP48P
         rYkop4vDJ5FURiC1phS+M8So3ZOLRqBJNutxEc5oEtUxk1VrVtYxpPfjls3LeZjkAfhK
         XGRyMcvFXfFnJl/XeV13b9o7zFoniPsi6d7+GlsZxVKOK4XpPHQppGOt5utCr/z1gqXu
         81Vg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=CUKTAOE0xwnV4R2pyXDQEwdwf22uiLewLTTbz1R0bPM=;
        b=UYINseAc3irXq5+q9XD87f+aHs4ypByCUihW4sudlZxOlvXgVFHNGF6ygnlOSRqvcS
         wYSotNBvrF4neXIk4VsVtB/VnRQugN3cT64eVroLXbQOrTaWCa5gdaK8GU8UaRhnXBFr
         FcOqlgItzX/Vh5RDAzsZPqEuXJ4nM2leXFWuA0wY292a0BW2wCNndYB0ZQkCxKRZWNBP
         phfgHfODncfx+pUKSsf0eSKxQ3toYqeuFZEy8s9HAVN7XNdOZjfGvKuSyh3u6VWB5wjR
         J2IJ+vMv1K3pTiqlTE5N+Bxck9Jw8hRRCNo1nwzU5Vd9mWGvIVzqFeJ1vyTT8y3GEytQ
         X+8w==
X-Gm-Message-State: AHYfb5jIRnlvqfXZ0WQNmGAQSazXa24DC2dJAno3I8b3H/C8yVLL8ydl
	Fo1WElDLTithBU8q
X-Received: by 10.99.158.85 with SMTP id r21mr6439323pgo.195.1502333126492;
        Wed, 09 Aug 2017 19:45:26 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.111.9 with SMTP id x9ls6730742itb.16.gmail; Wed, 09 Aug
 2017 19:45:25 -0700 (PDT)
X-Received: by 10.200.41.241 with SMTP id 46mr13073700qtt.339.1502333125332;
        Wed, 09 Aug 2017 19:45:25 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1502333125; cv=none;
        d=google.com; s=arc-20160816;
        b=nXF/Z9wTfd4UEYrLguGTnhOUkjfsAYj30NPSjFPeuFhmTQHPauWzPjcCx+0ZVKlW16
         UTftonX6WOY6nBsT0m1NELMaat4Ctigd+YEvkqHWW5BmZonv7L3xiFAvpioFlIKc0Zck
         maoCgsyEnsOcpPRYmKxY7U8gOIYVGgnVbQFLK1bGij/6C7TSIaIYdakrKDhvSIiQo3jb
         OYMWS8h0O3FaLELet68AOCSN984y4IpXGXTFlVGLxHdvILt4HEcsYf9KCGYhIUo+I3ye
         bHQWerc2Yd9rWMsPPo6GOUupbEGnzTtZHpzUhjnd/ydYleFcwKIucYFzpzw9EQestdYp
         1VZw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:references:in-reply-to:mime-version
         :dkim-signature:arc-authentication-results;
        bh=uTh6YZO8VvLiVAJwXRNz0C0bXnUkHoxvuP7oRqLp/hE=;
        b=gKtpSJDgqdwOUdhLo6sWi7uxqqY5+wF4YxYjSPI2n5Z/I+Zu6BWC0F4eXYhy6Bn9q9
         ugIDF7yUlR8VyekwYMx0QXp+0AtXzWLjb6GoU6LkkAPlsSS0Eq+Oh8EFJHZmwHZIGQJg
         GbDtcF2UegoGe0JZjKgdNbQIX6zH6JENuK4EXT0od6FE/kbPDuiKOzA3lOdgsiV90fxm
         LyXLBdD+nYeccqwtK082qObfAlTUeZk+Fm6Xz67IGIuQ3reH3f3mwAfyW3yrWESuI6ix
         Lgabgzkew57s+rhhm3fSrTYZ39RB86oSm4w2r8pDH/0l7DejlwsAgdnMoZjIK5qgATv7
         v/zQ==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=vgNwZED8;
       spf=pass (google.com: domain of tvaneerd@gmail.com designates 2607:f8b0:400d:c0d::232 as permitted sender) smtp.mailfrom=tvaneerd@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Original-Received: from mail-qt0-x232.google.com (mail-qt0-x232.google.com. [2607:f8b0:400d:c0d::232])
        by mx.google.com with ESMTPS id s3si4482493qtg.497.2017.08.09.19.45.25
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 09 Aug 2017 19:45:25 -0700 (PDT)
Received-SPF: pass (google.com: domain of tvaneerd@gmail.com designates 2607:f8b0:400d:c0d::232 as permitted sender) client-ip=2607:f8b0:400d:c0d::232;
Original-Received: by mail-qt0-x232.google.com with SMTP id t37so46965855qtg.5
        for <std-proposals@isocpp.org>; Wed, 09 Aug 2017 19:45:25 -0700 (PDT)
X-Received: by 10.237.36.38 with SMTP id r35mr14707898qtc.327.1502333125001;
 Wed, 09 Aug 2017 19:45:25 -0700 (PDT)
Original-Received: by 10.237.42.10 with HTTP; Wed, 9 Aug 2017 19:45:24 -0700 (PDT)
In-Reply-To: <omgg26$pob$1@blaine.gmane.org>
X-Original-Sender: tvaneerd@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=vgNwZED8;       spf=pass
 (google.com: domain of tvaneerd@gmail.com designates 2607:f8b0:400d:c0d::232
 as permitted sender) smtp.mailfrom=tvaneerd@gmail.com;       dmarc=pass
 (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:33770
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33770>

--001a113d3aac4008d805565d3086
Content-Type: text/plain; charset="UTF-8"

On Wed, Aug 9, 2017 at 10:23 PM, Bo Persson <bop@gmb.dk> wrote:

> On 2017-08-10 03:13, gmisocpp@gmail.com wrote:
>
>>
>>
>> On Thursday, August 10, 2017 at 5:08:18 AM UTC+12, Tony V E wrote:
>>
>>     break by default is fine, how do I opt-out within switch break, or
>>     is it all or nothing?
>>
>>     switch break(x)
>>     {
>>     case 1:
>>     case 2:
>>          foo();
>>     case 3:
>>          bar();
>>     case 4:
>>          etc();
>>       }
>>
>>
>>     How do I get fallthru on case 1 to 2?
>>
>>
>> I would not object to fallthrough being a keyword like so (but see later):
>>
>> switch break(x)
>> {
>> case 1: fallthrough;
>> case 2:
>>      foo();
>> case 3:
>>      bar();
>> case 4:
>>      etc();
>>   }
>>
>>
> That would make it really experts-only, as we already have the current
> version
>
> switch (x)
> {
> case 1: [[fallthrough]];
> case 2:
>      foo();
> case 3:
>      bar();
> case 4:
>      etc();
>   }
>
>
> How many variations do we need?
>
>
>     Bo Persson
>
>
Well, the [[fallthrough]] one, in some sense, doesn't really exist, because
attributes are ignorable and don't change anything.

I don't expect to ever get "switch break (x)", but I do expect we
eventually get pattern matching that subsumes switch.  Maybe "switch [x]",
since square brackets are in style? Or throw in an auto or something.  Or
it is called "inspect" (that's the name Bjarne used).

When we do get "inspect", it we almost certainly break by default.  I think
we will still _probably_ need something to do fallthrough - and it can't be
an attribute.
Or maybe we say fallthrough really isn't worth it.


-- 
Be seeing you,
Tony

-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAOHCbisUO1-rHoSrFK-qc76OFxPsVx3NJOnyV6vb1WFDcwQ-NA%40mail.gmail.com.

--001a113d3aac4008d805565d3086
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On Wed, Aug 9, 2017 at 10:23 PM, Bo Persson <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:bop@gmb.dk" target=3D"_blank">bop@gmb.dk</a>&gt;</span> wrote:=
<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-lef=
t:1px #ccc solid;padding-left:1ex"><span>On 2017-08-10 03:13, <a href=3D"ma=
ilto:gmisocpp@gmail.com" target=3D"_blank">gmisocpp@gmail.com</a> wrote:<br=
>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
<br>
<br>
On Thursday, August 10, 2017 at 5:08:18 AM UTC+12, Tony V E wrote:<br>
<br>
=C2=A0 =C2=A0 break by default is fine, how do I opt-out within switch brea=
k, or<br>
=C2=A0 =C2=A0 is it all or nothing?<br>
<br>
=C2=A0 =C2=A0 switch break(x)<br>
=C2=A0 =C2=A0 {<br>
=C2=A0 =C2=A0 case 1:<br>
=C2=A0 =C2=A0 case 2:<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0foo();<br>
=C2=A0 =C2=A0 case 3:<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bar();<br>
=C2=A0 =C2=A0 case 4:<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0etc();<br>
=C2=A0 =C2=A0 =C2=A0 }<br>
<br>
<br>
=C2=A0 =C2=A0 How do I get fallthru on case 1 to 2?<br>
<br>
<br>
I would not object to fallthrough being a keyword like so (but see later):<=
br>
<br>
switch break(x)<br>
{<br>
case 1: fallthrough;<br>
case 2:<br>
=C2=A0 =C2=A0 =C2=A0foo();<br>
case 3:<br>
=C2=A0 =C2=A0 =C2=A0bar();<br>
case 4:<br>
=C2=A0 =C2=A0 =C2=A0etc();<br>
=C2=A0 }<br>
<br>
</blockquote>
<br></span>
That would make it really experts-only, as we already have the current vers=
ion<br>
<br>
switch (x)<span><br>
{<br>
case 1: [[fallthrough]];<br>
case 2:<br>
=C2=A0 =C2=A0 =C2=A0foo();<br>
case 3:<br>
=C2=A0 =C2=A0 =C2=A0bar();<br>
case 4:<br>
=C2=A0 =C2=A0 =C2=A0etc();<br>
=C2=A0 }<br>
<br>
<br></span>
How many variations do we need?<br>
<br>
<br>
=C2=A0 =C2=A0 Bo Persson<span><br>
<br></span></blockquote><div><br></div><div>Well, the [[fallthrough]] one, =
in some sense, doesn&#39;t really exist, because attributes are ignorable a=
nd don&#39;t change anything.<br><br></div><div>I don&#39;t expect to ever =
get &quot;switch break (x)&quot;, but I do expect we eventually get pattern=
 matching that subsumes switch.=C2=A0 Maybe &quot;switch [x]&quot;, since s=
quare brackets are in style? Or throw in an auto or something.=C2=A0 Or it =
is called &quot;inspect&quot; (that&#39;s the name Bjarne used).<br><br></d=
iv><div>When we do get &quot;inspect&quot;, it we almost certainly break by=
 default.=C2=A0 I think we will still _probably_ need something to do fallt=
hrough - and it can&#39;t be an attribute.<br></div><div>Or maybe we say fa=
llthrough really isn&#39;t worth it.<br><br><br></div></div>-- <br><div cla=
ss=3D"m_736059209292639619gmail_signature" data-smartmail=3D"gmail_signatur=
e"><div dir=3D"ltr"><div>Be seeing you,<br></div>Tony<br></div></div>
</div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAOHCbisUO1-rHoSrFK-qc76OFxPsVx3NJOny=
V6vb1WFDcwQ-NA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAOHCbisUO1-rHoSr=
FK-qc76OFxPsVx3NJOnyV6vb1WFDcwQ-NA%40mail.gmail.com</a>.<br />

--001a113d3aac4008d805565d3086--

.
