Re: First-class callable partial application
| From: | Dan Ackroyd | Date: | Wed, 15 Mar 2023 21:12:11 +0000 |
| Subject: | Re: First-class callable partial application | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-119717@lists.php.net to get a copy of this message | ||
On Tue, 14 Mar 2023 at 16:58, Larry Garfield <larry@garfieldtech.com> wrote:
>
> New engine approach first, then syntax based on what that approach allows.
Would it be desirable to split those two things into two separate
RFCs, by having the first RFC not have native syntax support, but
instead another static method on Closure? e.g. something like:
Closure::partial($callable, array $position_params, array
$named_params): Closure {}
and would follow the pattern of Closure::fromCallable() being
implemented in 7.1, and the built-in syntax took until 8.1.
That would also allow creating partially applied functions in a data-driven way.
cheers
Dan
Ack