Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105156 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 40887 invoked from network); 9 Apr 2019 09:59:45 -0000 Received: from unknown (HELO v-smtpout1.han.skanova.net) (81.236.60.154) by pb1.pair.com with SMTP; 9 Apr 2019 09:59:45 -0000 Received: from [192.168.7.8] ([213.64.245.126]) by cmsmtp with ESMTPA id DkgLhZWAqSq0xDkgLhtyad; Tue, 09 Apr 2019 08:56:34 +0200 To: Nikita Popov References: Cc: Sara Golemon , PHP internals Message-ID: <582b57dc-42a0-582b-9471-2ede97ba584a@telia.com> Date: Tue, 9 Apr 2019 08:56:34 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-CMAE-Envelope: MS4wfMYVUWL6OmXaVBbyIWO9+ZLhySIJg+I7Hg95k18SNFXb0o4elr5mkvU/ex+wROleymFUK0c8jsNpeoDD1w9Wk44iSlin4+naVzC5vz6eUpIAGTyOSDXJ UfiacssJG4OP9ul45FOFJer4bBD3hjtQPAE/ampQ8VsZvHCO4YWpjOz8Xx60IfyKRvkD0oWTUCJyBcE6QvsQfRgcqzLfGsHFqdvp2KmFW4oR1nCzdHrleVG9 OtgyN77SZtO+pU1AI94zMw== Subject: Re: [PHP-DEV] Re: [RFC] Arrow functions / short closures From: bjorn.x.larsson@telia.com (=?UTF-8?Q?Bj=c3=b6rn_Larsson?=) Den 2019-04-08 kl. 16:06, skrev Nikita Popov: > On Wed, Mar 13, 2019 at 4:56 PM Nikita Popov wrote: > >> Hi internals, >> >> Motivated by the recent list comprehensions RFC, I think it's time we took >> another look at short closures: >> >> https://wiki.php.net/rfc/arrow_functions_v2 >> >> This is based on a previous (withdrawn) proposal by Levi & Bob. It uses >> the syntax >> >> fn($x) => $x * $multiplier >> >> and implicit by-value variable binding. This example is roughly equivalent >> to: >> >> function($x) use($multiplier) { return $x * $multiplier; } >> >> The RFC contains a detailed discussion of syntax choices and binding modes. >> >> Regards, >> Nikita >> > Heads up: I plan to start voting on this RFC tomorrow if nothing new comes > up. > > Most of the discussion was (as expected) about the choice of syntax. > Ultimately I think there are many reasonable choices we can make here, but > we should stick to a specific proposal for the purposes of the RFC vote. > None of the given arguments convinced me that some other syntax is > *strictly* better than the proposed fn($x, $y) => $x*$y -- it's more a > matter of some choices being slightly better in one case and slightly worse > in another. My personal runner-up would be \($x, $y) => $x*$y, but I > suspect that there are some people who are more strongly biased against > "sigil salad" than I am... > > Nikita Hi, I recall that the perception of the ==> syntax in the Hacklang user community was quite positive. Of course it was implementation difficulties. Are they still to cumbersome in PHP? Personally I prefer that one being more readable or the \ one. Anyway, glad to see that short closures finally is on the road again! r//Björn L