Re: [RFC] First-class callable syntax
| From: | Olle Härstedt | Date: | Tue, 29 Jun 2021 08:52:25 +0000 |
| Subject: | Re: [RFC] First-class callable syntax | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-115205@lists.php.net to get a copy of this message | ||
2021-05-20 14:48 GMT+02:00, Nikita Popov <nikita.ppv@gmail.com>:
> Hi internals,
>
> I'd like to present an RFC for a first-class callable syntax, which is
> intended as a simpler alternative to the partial function application (PFA)
> proposal:
>
> https://wiki.php.net/rfc/first_class_callable_syntax
>
> See the Rationale section for details on how this relates to PFA. Over the
> past week, we've had a lot of discussions on how exactly PFA is supposed to
> work (most of them OTR), and while we seem to have a tentative consensus on
> the correct model to use (which does not match the current RFC), it's clear
> that this feature has turned out more complicated than originally
> anticipated. Joe (who provided the implementation for the PFA RFC) is also
> concerned about the implementation complexity that the final model would
> require.
>
> At least I personally was mainly interested in PFA because it provides a
> first-class callable syntax as a side-effect. This RFC goes back to
> providing *just* that. The syntax is forward-compatible with a future PFA
> proposal though.
>
> Regards,
> Nikita
More bikeshedding, sorry. Was a syntax using
fn considered? Like
$fn = Closure::fromCallable('strlen');
$fn = fn strlen;
or
$fn = (fn) strlen;
Olle