Re: [RFC][Discuss] Arrow Functions
| From: | Rowan Collins | Date: | Tue, 30 May 2017 12:45:02 +0000 |
| Subject: | Re: [RFC][Discuss] Arrow Functions | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-99263@lists.php.net to get a copy of this message | ||
On 30 May 2017 09:30:02 BST, "Björn Larsson" <bjorn.x.larsson@telia.com> wrote:
>I presume then that the options discussed earlier "|params| => expr"
>and "lamda(params) => expr" are of the table.
I'm a fan of "lambda(params) => expr" myself, because unlike "fn", it
makes it clear that this is a *new type of definition*, not just shorthand for an existing anonymous
function. Of the other options, the C++ style also offers this, because you have to add the = or
& to turn on the auto-capturing.
And to reiterate from previous discussions, it is the automatic capturing that is the biggest new
feature here; it's a radical departure from every other scope in PHP, for better or worse.
Regards,
--
Rowan Collins
[IMSoP]