Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88149 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84051 invoked from network); 10 Sep 2015 21:15:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Sep 2015 21:15:58 -0000 Authentication-Results: pb1.pair.com header.from=bjorn.x.larsson@telia.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=bjorn.x.larsson@telia.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain telia.com from 81.236.60.155 cause and error) X-PHP-List-Original-Sender: bjorn.x.larsson@telia.com X-Host-Fingerprint: 81.236.60.155 v-smtpout2.han.skanova.net Received: from [81.236.60.155] ([81.236.60.155:33413] helo=v-smtpout2.han.skanova.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3C/00-17430-C03F1F55 for ; Thu, 10 Sep 2015 17:15:57 -0400 Received: from [192.168.7.6] ([195.198.188.252]) by cmsmtp with SMTP id a9CDZSbc5UMDoa9CDZDErh; Thu, 10 Sep 2015 23:15:53 +0200 To: Bob Weinand References: <55E77CA9.7050609@gmail.com> <55F1E269.60403@telia.com> Cc: PHP internals Message-ID: <55F1F30B.3030409@telia.com> Date: Thu, 10 Sep 2015 23:15:55 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------010407020000090302040409" X-CMAE-Envelope: MS4wfJtAOm+qFcZ3OoZ8IGlo8TB/eOitOXt7Cu1r4xRlMUWMxoS0jhyC04/c7ZMSuU7sPA4xHVBRsbdhJ+ckvMoiWzOT9k3umPuC2J5HcrTnsxvLsAFApqjm1U5np3v7f1TXiGjX8N2LYQ7lbYMnEqpektCgi+U1r+S5EdmqeBpVRrPq7lEOm19SsoJ1x9rtOtKIbGNi+BuD4hmvKxu7pAvRNdEiK/aLKNqMRL1QiaeawDSA Subject: Re: [PHP-DEV] [RFC] [Discussion] Short Closures From: bjorn.x.larsson@telia.com (=?UTF-8?Q?Bj=c3=b6rn_Larsson?=) --------------010407020000090302040409 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Den 2015-09-10 kl. 22:22, skrev Bob Weinand: >> Am 10.09.2015 um 22:04 schrieb Björn Larsson : >> >> Den 2015-09-03 kl. 00:48, skrev Rowan Collins: >>> Amendment 3. Make the parentheses around the argument list mandatory so that (if Amendment 1 is also adopted) there is only a single variant of the syntax, namely "( param list ) ~> expression". >>> >> Any plans to incorporate any of the amendments above in the RFC? >> Personally I favour amendment 3. One of your examples would be: >> functionreduce(callable $fn){ >> return($initial)~>($input)~>{ >> $accumulator=$initial; >> foreach($inputas$value){ >> $accumulator=$fn($accumulator,$value); >> } >> return$accumulator;}; >> } >> >> Or maybe I'm just overly familiar having function arguments >> within parenthesis ;) >> >> Regards, //Björn Larsson > You are probably just very familiar with them ;-) > > It totally isn't unusual to have that (for languages allowing untyped params), see: > Javascript (ES6) > Hack > C# > > (There probably are more, I just can recall these three off my head) > > So, I think this very much falls under personal preference. > > Bob Yes, for me it's about not needing to think whether parenthesis should be there or not. So one more thing to not think about... Anyway, I noticed that both C# and Hack uses lamda functions for asynchronous programming, so good to get going with this RFC! Hack example: |async (int $x, string $y): Awaitable ==> await $x->genFoo($y, $z); //Björn | --------------010407020000090302040409--