220 21072 <37415448-4691-4d36-bd73-e4afac23cf4b@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Arthur O'Dwyer <arthur.j.odwyer@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: auto return
Date: Wed, 30 Sep 2015 15:56:07 -0700 (PDT)
Lines: 136
Approved: news@gmane.org
Message-ID: <37415448-4691-4d36-bd73-e4afac23cf4b@isocpp.org>
References: <CAB+4KHLBYKxVQsSd_Q-LybNLdx5W9vLJ1HKY6Um8Lwe7vVKE1w@mail.gmail.com>
 <7deedcff-6776-4b3b-a3d1-3132f8ec1ae3@isocpp.org>
 <muhd9i$ib$1@ger.gmane.org>
 <CAOHCbisBfHSGbynNAVpZNdXxfojQKPsMK=DS++rG+B3uXj16sw@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_9720_640582435.1443653767270"
X-Trace: ger.gmane.org 1443653775 6937 80.91.229.3 (30 Sep 2015 22:56:15 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 30 Sep 2015 22:56:15 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDLZJYWNDQIIRUNRWACRUBD2DKI34@isocpp.org Thu Oct 01 00:56:10 2015
Return-path: <std-proposals+bncBDLZJYWNDQIIRUNRWACRUBD2DKI34@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pa0-f70.google.com ([209.85.220.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDLZJYWNDQIIRUNRWACRUBD2DKI34@isocpp.org>)
	id 1ZhQIE-0007hG-Bn
	for gclcip-std-proposals@m.gmane.org; Thu, 01 Oct 2015 00:56:10 +0200
Original-Received: by pacex11 with SMTP id ex11sf94100562pac.2
        for <gclcip-std-proposals@m.gmane.org>; Wed, 30 Sep 2015 15:56:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :content-type: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=TbAx+uPmXZ/Ff9mrutLKVYZdaE9oguXredBPDihePbE=;
        b=zFS824rRrPl+8kyDh1x+s0vZcYZI/52meTZqyJee1hVxcDCqHj0ZUHTenAH/ZUyKKX
         6TA8GKQZ10O5Ayv9/0jVhFB4eg71AplD0n5I9o5O4X0+SbOhUextiYmrQBswsfo3+uem
         Fug60zDBi424MIEb+ERA0+HFBEhatRj7Jbd7PE905PmW+3VN5u41rrm0/p3oOust7keV
         J3wQhMxE3HGqYITlHlOGmaN0dZ1co02Gbsz793L0o9/0waCOcy51eKoFQYqo2aMdRO4C
         aWeIQeKCHUErMbSFOVB2wjDvGT2B1NNKb+jTJXKQDU4yjAAAg19wj9eTQnNh8AuMisDF
         dBDg==
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:message-id:in-reply-to:references
         :subject:mime-version:content-type: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=TbAx+uPmXZ/Ff9mrutLKVYZdaE9oguXredBPDihePbE=;
        b=PzCujQYLCBNsvYpcpXQ9WjkKPcqD8V2GAtFfDsZHONVyJpeR2FRYycD9JnAPeVXq4S
         9stLc0AM19I6CQudfZqEGnl6yOmR6ZH+ffssKAFe5gIXSSy2gbMltg7/Q92GKWLvgtoU
         6tsT6s7aa4Zh/oSGFiC+ueasjLUV2A1X3PrzKmslDh4GDRg71NrpeN9m928PMJLaeBC8
         28GjrRXvL35JOY6LmA9NGtTOOMZkRpnk3GaGkhKOrZeP3CPbfRx1TkQaGln/1KBG4DfC
         L2F5GaqC+Qqq00nIaxBuh4vhLpS1w/2VphrfYinsgR2Ib5I1pkHB8HNY6h/UGYj2z65a
         pLdg==
X-Gm-Message-State: ALoCoQn+/2QRZBIWLCdM6P8vAQShUlK675sozVsGNStYFrJpyPVvUnaj9Bjg7yibcymdbyimOQ1S
X-Received: by 10.68.206.106 with SMTP id ln10mr5429935pbc.5.1443653769148;
        Wed, 30 Sep 2015 15:56:09 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.61.100 with SMTP id o4ls37755igr.26.canary; Wed, 30 Sep
 2015 15:56:08 -0700 (PDT)
X-Received: by 10.50.110.74 with SMTP id hy10mr253788igb.1.1443653768296;
        Wed, 30 Sep 2015 15:56:08 -0700 (PDT)
In-Reply-To: <CAOHCbisBfHSGbynNAVpZNdXxfojQKPsMK=DS++rG+B3uXj16sw@mail.gmail.com>
X-Original-Sender: arthur.j.odwyer@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://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>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:21072
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/21072>

------=_Part_9720_640582435.1443653767270
Content-Type: multipart/alternative; 
	boundary="----=_Part_9721_545280241.1443653767271"

------=_Part_9721_545280241.1443653767271
Content-Type: text/plain; charset=UTF-8

Turning "return" into a primary-expression is a non-starter.

    int foo() {
        return+1;
    }

    int bar() {
        return(1);
    }

and probably some really crazy arbitrary-lookahead-requiring things with 
lambda syntax: is return[a=1] an array indexing expression or a return 
statement returning a lambda?

So we can forget about that syntax and go back to the whiteboard... which 
means re-confronting the question of "what problem is it that we're really 
trying to solve, again?"  Is it that our shortest functions aren't short 
enough?  Is it that we don't feel in control enough of RVO and want to 
annotate the "return-slot variable" for our own peace of mind?  ...What's 
the problem being solved?


On Wednesday, September 30, 2015 at 12:41:14 PM UTC-7, Tony V E wrote:
>
>
>
> On Wed, Sep 30, 2015 at 3:30 PM, Matthew Woehlke <mwoehlk...@gmail.com 
> <javascript:>> wrote:
>
>>
>> I've written '<decl> result; ... return result;' often enough that I
>> wouldn't mind a shortcut. I'd be potentially interested in this much of
>> the proposal:
>>
>>   auto foo(...) // arguments not important
>>   {
>>     while (...)
>>       return.emplace_back(...);
>>     return;
>>   }
>>
>> That is, one can use 'return' as a local variable;
>
>
> In that case, I'd expect that last line to be
>
>     return return;
>
> And (sadly?) I think I'd be more comfortable with that.
>
> 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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_9721_545280241.1443653767271
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Turning &quot;return&quot; into a primary-expression =
is a non-starter.</div><div><br></div><div>=C2=A0 =C2=A0 int foo() {</div><=
div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 return+1;</div><div>=C2=A0 =C2=A0 }</div><d=
iv><br></div><div>=C2=A0 =C2=A0 int bar() {</div><div>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 return(1);</div><div>=C2=A0 =C2=A0 }</div><div><br></div><div>and pr=
obably some really crazy arbitrary-lookahead-requiring things with lambda s=
yntax: is return[a=3D1] an array indexing expression or a return statement =
returning a lambda?</div><div><br></div><div>So we can forget about that sy=
ntax and go back to the whiteboard... which means re-confronting the questi=
on of &quot;what problem is it that we&#39;re really trying to solve, again=
?&quot; =C2=A0Is it that our shortest functions aren&#39;t short enough? =
=C2=A0Is it that we don&#39;t feel in control enough of RVO and want to ann=
otate the &quot;return-slot variable&quot; for our own peace of mind? =C2=
=A0...What&#39;s the problem being solved?</div><div><br></div><br>On Wedne=
sday, September 30, 2015 at 12:41:14 PM UTC-7, Tony V E wrote:<blockquote c=
lass=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px=
 #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><br><div><br><div class=3D=
"gmail_quote">On Wed, Sep 30, 2015 at 3:30 PM, Matthew Woehlke <span dir=3D=
"ltr">&lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=
=3D"Y54BkKZdCgAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;javascri=
pt:&#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;return =
true;">mwoehlk...@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"g=
mail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-l=
eft:1ex"><span><br>
</span>I&#39;ve written &#39;&lt;decl&gt; result; ... return result;&#39; o=
ften enough that I<br>
wouldn&#39;t mind a shortcut. I&#39;d be potentially interested in this muc=
h of<br>
the proposal:<br>
<br>
=C2=A0 auto foo(...) // arguments not important<br>
=C2=A0 {<br>
=C2=A0 =C2=A0 while (...)<br>
=C2=A0 =C2=A0 =C2=A0 return.emplace_back(...);<br>
=C2=A0 =C2=A0 return;<br>
=C2=A0 }<br>
<br>
That is, one can use &#39;return&#39; as a local variable;</blockquote><div=
><br></div><div>In that case, I&#39;d expect that last line to be<br><br></=
div><div>=C2=A0=C2=A0=C2=A0 return return;<br><br></div><div>And (sadly?) I=
 think I&#39;d be more comfortable with that.<br></div></div><br></div><div=
>Tony<br><br></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_9721_545280241.1443653767271--
------=_Part_9720_640582435.1443653767270--

.
