220 29645 <CAMeU-s36yo6iSW7kn+D9ZGAZzcgUEg9MQ6O0vfc9U-JjjzQi6A@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Mikhail Semenov <mikhailsemenov1957@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: compiler should infer last semicolon of culy
 brace block... it makes lambas look better....
Date: Sun, 4 Dec 2016 10:44:22 +0000
Lines: 118
Approved: news@gmane.org
Message-ID: <CAMeU-s36yo6iSW7kn+D9ZGAZzcgUEg9MQ6O0vfc9U-JjjzQi6A@mail.gmail.com>
References: <99df401b-562e-424f-9c17-01575f8b47e1@isocpp.org>
 <a09f1541-1574-4eed-a030-60a485510436@isocpp.org> <5876fa59-f31f-4b93-969a-8ab0437f2f55@isocpp.org>
 <da79b48a-99ac-4f12-86ff-28792fccf5d6@isocpp.org> <d293b81b-1153-4aef-a253-6d7ab8d168aa@isocpp.org>
 <1480711391.2485.1.camel@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a11410152b1c0c80542d2dad7
X-Trace: blaine.gmane.org 1480848265 8040 195.159.176.226 (4 Dec 2016 10:44:25 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sun, 4 Dec 2016 10:44:25 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDC55PNFRYGRBB7HR7BAKGQEOAJFTRQ@isocpp.org Sun Dec 04 11:44:21 2016
Return-path: <std-proposals+bncBDC55PNFRYGRBB7HR7BAKGQEOAJFTRQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-oi0-f72.google.com ([209.85.218.72])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDC55PNFRYGRBB7HR7BAKGQEOAJFTRQ@isocpp.org>)
	id 1cDUHM-0001ND-WC
	for gclcip-std-proposals@m.gmane.org; Sun, 04 Dec 2016 11:44:21 +0100
Original-Received: by mail-oi0-f72.google.com with SMTP id w63sf500362831oiw.4
        for <gclcip-std-proposals@m.gmane.org>; Sun, 04 Dec 2016 02:44:25 -0800 (PST)
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:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=hm2ISkZUDJOmMKqFj2Ub8hjS6nVEbTW4g9UyP3QkD0U=;
        b=q1Yvabo1BCBx2YKnnpJHxLVepdfPNXzd3K5e79Anxh2nGzPCgMLJ9bCnLUPGUUhT3E
         VApXkK7aw7LaGklQXp16IY9DMFOOkxbmipxzInseoZ6XIP1injwbZ+vYXp5yxAe3n2R7
         9TtMnJirJ5lmNpGc8oAhjLOZ/l+idtSx6AboCLqbqSssY/nI0iNz8pkQdIKhuFoBc4ex
         SyXbl8jExwY3tTIAdeWURIipMuHCjJQ8ncGb25LcUqeK/KJUANW7HBZgdgl6FLFIThKg
         m7zGQ/gOWaEckPe8qBWFMxr5ICjsp6zDVkTut4yeWMkGdgPQBbFE/c+RBEms1qtggLSz
         Ppuw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        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=hm2ISkZUDJOmMKqFj2Ub8hjS6nVEbTW4g9UyP3QkD0U=;
        b=hPuyOoOBMwFboovy23ACqfC+nColYmq7CZgVVizCY8GNBgDuxdBQbzukPeDYj3Jvm2
         zKJVJ4RPbREnEleIWU6XrS13q9DBMSTy1y2BQciWE0holUvLDvgvWw4OpXUOGNnBKVs9
         PgQj1MNs3g/cfErPe+mb9O5R1zXLwn72FrTH4xmCpmBSzcZ9SoxGThrZKVu7giJERlpg
         A7wcLYWlPOzXNepqhNBo/8x0h/5iTiIMw3T5K4qL4ijNUWUZr4Wm2Jj7d23TB5gDvdMr
         QFw8gk20AZxHmqC56PReODeYhI48jVGoJuVPpk8iOrnXx5Fbjrg0E3lG5xITQrH/kInr
         1CcQ==
X-Gm-Message-State: AKaTC035FSATXnY13d+vQHg1D8UG+J7/Ax0uhgmBMfbr4/NDJio3cf2g024Ei4Fq1RvPhw==
X-Received: by 10.157.0.37 with SMTP id 34mr13094738ota.100.1480848264565;
        Sun, 04 Dec 2016 02:44:24 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.11.120 with SMTP id p53ls13083701otd.13.gmail; Sun, 04 Dec
 2016 02:44:23 -0800 (PST)
X-Received: by 10.55.100.67 with SMTP id y64mr45531678qkb.118.1480848263619;
        Sun, 04 Dec 2016 02:44:23 -0800 (PST)
Original-Received: from mail-qt0-x22d.google.com (mail-qt0-x22d.google.com. [2607:f8b0:400d:c0d::22d])
        by mx.google.com with ESMTPS id h24si6802542qtf.266.2016.12.04.02.44.23
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sun, 04 Dec 2016 02:44:23 -0800 (PST)
Received-SPF: pass (google.com: domain of mikhailsemenov1957@gmail.com designates 2607:f8b0:400d:c0d::22d as permitted sender) client-ip=2607:f8b0:400d:c0d::22d;
Original-Received: by mail-qt0-x22d.google.com with SMTP id n6so290768338qtd.1
        for <std-proposals@isocpp.org>; Sun, 04 Dec 2016 02:44:23 -0800 (PST)
X-Received: by 10.200.37.241 with SMTP id f46mr45181635qtf.164.1480848263194;
 Sun, 04 Dec 2016 02:44:23 -0800 (PST)
Original-Received: by 10.140.83.75 with HTTP; Sun, 4 Dec 2016 02:44:22 -0800 (PST)
In-Reply-To: <1480711391.2485.1.camel@gmail.com>
X-Original-Sender: mikhailsemenov1957@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 mikhailsemenov1957@gmail.com designates 2607:f8b0:400d:c0d::22d as permitted
 sender) smtp.mailfrom=mikhailsemenov1957@gmail.com;       dmarc=pass (p=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:29645
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29645>

--001a11410152b1c0c80542d2dad7
Content-Type: text/plain; charset=UTF-8

The C/C++ rules on semicolons in statements (not declarations) are a bit
odd in contrast to other languages like Pascal, where  semicolons are
required only between statements in a compound statement (I am using C
syntax to show this):
{S1;S2;...;Sn}

But, it also mean that a semicolon is not used before "else" (we could look
into this as well, whether it is viable option):
if (a>b) then x=a else x = b

But, in C/C++, there is the ugly switch statement, where semicolons are
probably required as well.


In addition, in some languages, the value {S1;S2;...;Sn} is the value of Sn
if it is the last executed statement/expression; otherwise it is the value
of the expression in the return statement.

All this can probably be implemented in C++, but all the syntactic
ambiguities should be carefully examined.

An then we will be able to write
[&y](int x) { y += x; x }





On 2 December 2016 at 20:43, Daniel Boles <db0451@gmail.com> wrote:

> For sure, that seems to be an irresolvable ambiguity that makes
> 'implied return' a non-starter.
>
> The optional semicolon is cute, I guess, but hardly the main issue with
> expressions of the complexity cited here.
>
> --
> 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/1480711391.2485.1.camel%40gmail.com.
>

-- 
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/CAMeU-s36yo6iSW7kn%2BD9ZGAZzcgUEg9MQ6O0vfc9U-JjjzQi6A%40mail.gmail.com.

--001a11410152b1c0c80542d2dad7
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>The C/C++ rules on semicolons in statements (not decl=
arations) are a bit odd in contrast to other languages like Pascal, where=
=C2=A0 semicolons are required only between statements in a compound statem=
ent (I am using C syntax to show this):</div><div>{S1;S2;...;Sn}</div><div>=
<br></div><div>But, it also mean that a semicolon is not used before &quot;=
else&quot; (we could look into this as well, whether it is viable option):<=
/div><div>if (a&gt;b) then x=3Da else x =3D b</div><div><br></div><div>But,=
 in C/C++, there is the=C2=A0ugly switch statement, where semicolons are pr=
obably required as well.</div><div><br></div><div><br></div><div>In additio=
n, in some languages, the value {S1;S2;...;Sn} is the value of Sn if it is =
the last executed statement/expression; otherwise it is the value of the ex=
pression in the return statement.</div><div><br></div><div>All this can pro=
bably be implemented in C++, but all the syntactic ambiguities should be ca=
refully examined.</div><div><br></div><div>An then we will be able to write=
</div><div>[&amp;y](int x) { y +=3D x; x }</div><div><br></div><div><br></d=
iv><div><br></div><div><br></div></div><div class=3D"gmail_extra"><br><div =
class=3D"gmail_quote">On 2 December 2016 at 20:43, Daniel Boles <span dir=
=3D"ltr">&lt;<a href=3D"mailto:db0451@gmail.com" target=3D"_blank">db0451@g=
mail.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">For sure=
, that seems to be an irresolvable ambiguity that makes<br>
&#39;implied return&#39; a non-starter.<br>
<br>
The optional semicolon is cute, I guess, but hardly the main issue with<br>
expressions of the complexity cited here.<br>
<span><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@<wbr>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>
</span>To view this discussion on the web visit <a href=3D"https://groups.g=
oogle.com/a/isocpp.org/d/msgid/std-proposals/1480711391.2485.1.camel%40gmai=
l.com" target=3D"_blank" rel=3D"noreferrer">https://groups.google.com/a/<wb=
r>isocpp.org/d/msgid/std-<wbr>proposals/1480711391.2485.1.<wbr>camel%40gmai=
l.com</a>.<br>
</blockquote></div><br></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/CAMeU-s36yo6iSW7kn%2BD9ZGAZzcgUEg9MQ6=
O0vfc9U-JjjzQi6A%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAMeU-s36yo6iSW=
7kn%2BD9ZGAZzcgUEg9MQ6O0vfc9U-JjjzQi6A%40mail.gmail.com</a>.<br />

--001a11410152b1c0c80542d2dad7--

.
