220 29617 <5876fa59-f31f-4b93-969a-8ab0437f2f55@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: compiler should infer last semicolon of culy
 brace block... it makes lambas look better....
Date: Fri, 2 Dec 2016 08:34:29 -0800 (PST)
Lines: 122
Approved: news@gmane.org
Message-ID: <5876fa59-f31f-4b93-969a-8ab0437f2f55@isocpp.org>
References: <99df401b-562e-424f-9c17-01575f8b47e1@isocpp.org>
 <a09f1541-1574-4eed-a030-60a485510436@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_884_1915619394.1480696469605"
X-Trace: blaine.gmane.org 1480696471 782 195.159.176.226 (2 Dec 2016 16:34:31 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 2 Dec 2016 16:34:31 +0000 (UTC)
Cc: wm2015email@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBFWFQ3BAKGQEC3QOX2A@isocpp.org Fri Dec 02 17:34:27 2016
Return-path: <std-proposals+bncBCEKFTV6ZUMBBFWFQ3BAKGQEC3QOX2A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qk0-f199.google.com ([209.85.220.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBFWFQ3BAKGQEC3QOX2A@isocpp.org>)
	id 1cCqn5-0007s4-34
	for gclcip-std-proposals@m.gmane.org; Fri, 02 Dec 2016 17:34:27 +0100
Original-Received: by mail-qk0-f199.google.com with SMTP id q128sf208963401qkd.3
        for <gclcip-std-proposals@m.gmane.org>; Fri, 02 Dec 2016 08:34:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=UYuUJ3StGLRg0DJDnk+yH1+kfGJqrLtZNwTTLO8dSag=;
        b=L2C55FVLP7b40ohthENZgf4AHjBb1kP5tFI7Z1SFbBTLr4kDKwma9xYkjhpIF060dH
         28X4WhPfgxflmtmCj2+YYsO/D5s3jZmj2we94ISH+i2RPKK9Lf9PMAajYQq5yJRPPwIR
         vSfW2+RKJbKgJqjBG76CW/HvffdsLc7IIAR5+2lTf3xJHt85PQhdc7H1gERIosu306Px
         WSVDjRfsesfHlMhOmesGuCsxKnfmrkSLjgx6hN2ihkJhFUGwBTgZl5Xx3CruV8ToH/vD
         gKvohIc7Xc6e7mzagQr0dC0Dmi7MaPKQJtulFOZPSxdW52X8OFD5jqzhQkak1HKBNTpg
         IlKA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=UYuUJ3StGLRg0DJDnk+yH1+kfGJqrLtZNwTTLO8dSag=;
        b=vRIyCMMHMSK2+HrhFhzi3gcCtzAqz3Eyz23pQH6KSpQsfo+AZl4o++uRsNCwELAZyP
         7dTAHcufT4Z71si4PStG2De3cKZ4ulZYYbu4KCbUFIfd20XSd5LHjSOAcXYLDnpZylLM
         P8nLBNDgHn8U/lECWcPYIxkxtJsqEzi1yHv5d2gd2LyCYLEFGbQR34tmPUsalvdgTgSN
         QfS2S6+UwyAHvyMmI701Tjh3uZ1956qQ9EdEPEeMn0hUJ+t1+3ctwdpWgywkwauk2zwF
         Q0sWDCRIQuww+JvH+EW5amGhzeDACeFfs0c37dn7gbHr7FiYjIqSZvgHTmYXKtWYe1ZA
         EkdQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:x-original-sender:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=UYuUJ3StGLRg0DJDnk+yH1+kfGJqrLtZNwTTLO8dSag=;
        b=XNVe0gPWmjuZca0QH2wejdTcf4b7vEC6orfjkr0BFe7Z0QXUI4IBYJ7I29CJ++AWjG
         YGlcOFcCVojLVs5fbitQnGyGWkI3hIWftJ0BKofhzzeoPbAXBvcXs9k6U2lHDomxhtNg
         rYJvsUCWDNRbjT8tgo9qOu3t8BM6n5K7oP3PPHKxS0nbUUHKjjvLok1WgNF/cqPKhaH1
         LWd7t41haD0cl+y+rc5J0RHpc6M0AjNszG/396wzyQswx7SdrWm4LZLxkk0IKmw/fGEr
         K8uc9UzFROo5ym+8hW4hoYcOH5XMy0r3uc73sXjpscgY+mK/90h9X7vfc4isoJBF1qy9
         MMsA==
X-Gm-Message-State: AKaTC00moTpJ8PGZUqUeKjnXe5cQ+y+okCJWmzQdmEwSAnkZVKkvL1Fyq8y1OUXT1qiL1Q==
X-Received: by 10.200.45.170 with SMTP id p39mr9305224qta.38.1480696470793;
        Fri, 02 Dec 2016 08:34:30 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.41.209 with SMTP id g17ls20668765otd.46.gmail; Fri, 02 Dec
 2016 08:34:30 -0800 (PST)
X-Received: by 10.157.4.119 with SMTP id 110mr3063347otc.11.1480696470114;
        Fri, 02 Dec 2016 08:34:30 -0800 (PST)
In-Reply-To: <a09f1541-1574-4eed-a030-60a485510436@isocpp.org>
X-Original-Sender: jmckesson@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:29617
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29617>

------=_Part_884_1915619394.1480696469605
Content-Type: multipart/alternative; 
	boundary="----=_Part_885_2086958458.1480696469606"

------=_Part_885_2086958458.1480696469606
Content-Type: text/plain; charset=UTF-8



On Friday, December 2, 2016 at 10:14:20 AM UTC-5, Jakob Riedle wrote:
>
> A comma is allowed there
>
>
> Truly...
>
> *Concerning your Idea:*
> I like it!
>
>
> Another Idea: How about making the "return" stmt obsolete, *when there is 
> no semicolon *(only within a lambda)? How about being able to write
>
> transform(begin(str), end(str), [](auto c){ toupper(c) } );
>
> *Why I said it: *Because making "return" optional when there is no 
> semicolon makes it a backwards-compatible change!
>
> Just an idea...
>

Look at how it conflicts with what the OP wanted:

menu1.callback("Log->Clear", [=]() {dosomething1(); dosomthing2()});

With his feature, this is still a `void` function. With what you want, it's 
equivalent to `return dosomething2()`. That might be `void` or it might 
not. There's no way to tell.

There are already some ideas around for making lambda-as-single-expression 
easier to write.

-- 
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/5876fa59-f31f-4b93-969a-8ab0437f2f55%40isocpp.org.

------=_Part_885_2086958458.1480696469606
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Friday, December 2, 2016 at 10:14:20 AM UTC-5, =
Jakob Riedle wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;mar=
gin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D=
"ltr"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;b=
order-left:1px solid rgb(204,204,204);padding-left:1ex">A comma is allowed =
there</blockquote><div><br></div><div>Truly...</div><div><br></div><div><b>=
Concerning your Idea:</b></div><div>I like it!</div><div><br></div><div><br=
></div><div>Another Idea: How about making the &quot;return&quot; stmt obso=
lete, <b>when there is no semicolon </b>(only within a lambda)? How about b=
eing able to write</div><div><br></div><div><div style=3D"background-color:=
rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;border-wi=
dth:1px;word-wrap:break-word"><code><div><span style=3D"color:#000">transfo=
rm</span><span style=3D"color:#660">(</span><span style=3D"color:#008">begi=
n</span><span style=3D"color:#660">(</span><span style=3D"color:#000">str</=
span><span style=3D"color:#660">),</span><span style=3D"color:#000"> </span=
><span style=3D"color:#008">end</span><span style=3D"color:#660">(</span><s=
pan style=3D"color:#000">str</span><span style=3D"color:#660">),</span><spa=
n style=3D"color:#000"> </span><span style=3D"color:#660">[](</span><span s=
tyle=3D"color:#008">auto</span><span style=3D"color:#000"> c</span><span st=
yle=3D"color:#660">){</span><span style=3D"color:#000"> toupper</span><span=
 style=3D"color:#660">(</span><span style=3D"color:#000">c</span><span styl=
e=3D"color:#660">)</span><span style=3D"color:#000"> </span><span style=3D"=
color:#660">}</span><span style=3D"color:#000"> </span><span style=3D"color=
:#660">);</span><span style=3D"color:#000"><br></span></div></code></div></=
div><div><br></div><div><b>Why I said it: </b>Because making &quot;return&q=
uot; optional when there is no semicolon makes it a backwards-compatible ch=
ange!</div><div><br></div><div>Just an idea...</div></div></blockquote><div=
><br>Look at how it conflicts with what the OP wanted:<br><br><div style=3D=
"background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); bo=
rder-style: solid; border-width: 1px; overflow-wrap: break-word;" class=3D"=
prettyprint"><code class=3D"prettyprint"><div class=3D"subprettyprint"><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify">menu1</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">.</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify">callback</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #080;" =
class=3D"styled-by-prettify">&quot;Log-&gt;Clear&quot;</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">[=3D]()</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify">dosomething1</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">();</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> dosomthing2</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">()});</span></div></code></div><br>With his feature, this is still a `vo=
id` function. With what you want, it&#39;s equivalent to `return dosomethin=
g2()`. That might be `void` or it might not. There&#39;s no way to tell.<br=
><br>There are already some ideas around for making lambda-as-single-expres=
sion easier to write.<br></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/5876fa59-f31f-4b93-969a-8ab0437f2f55%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/5876fa59-f31f-4b93-969a-8ab0437f2f55=
%40isocpp.org</a>.<br />

------=_Part_885_2086958458.1480696469606--

------=_Part_884_1915619394.1480696469605--

.
