Re: [RFC] Arrow functions / short closures
| From: | Ben Ramsey | Date: | Wed, 13 Mar 2019 19:36:07 +0000 |
| Subject: | Re: [RFC] Arrow functions / short closures | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-104694@lists.php.net to get a copy of this message | ||
> On Mar 13, 2019, at 10:56, Nikita Popov <nikita.ppv@gmail.com> 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.
Has the use of
Attachment: [application/pgp-signature] Message signed with OpenPGP signature.asc
f as a leading symbol been considered and discussed? For example:
f($x) => $x * $multiplier
Cheers,
Ben
Attachment: [application/pgp-signature] Message signed with OpenPGP signature.asc