Re: [RFC] Partial function application

From: Date: Wed, 12 May 2021 05:26:35 +0000
Subject: Re: [RFC] Partial function application
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-114425@lists.php.net to get a copy of this message
Hi Larry,

On Tue, May 11, 2021 at 8:55 PM Larry Garfield <larry@garfieldtech.com>
wrote:

>
> They currently do, since they work by creating a Closure-esque object
> called Partial with an __invoke() method.
>
> --Larry Garfield
>
>
1. Would it be possible to mention the Partial class in the RFC? From
what I understand this is what it will be returned by the
get_class($partial).
I guess the class will be final (similar with Closure) and will only have a
private constructor and a public __invoke method.

2. As now ReflectionFunction accepts Closure|string, wouldn't it be simpler
for the users to just have it accept Closure|Partial|string to avoid
introducing another reflection class and also avoid the userland issue you
mentioned?

Alex


Thread (68 messages)

« previous php.internals (#114425) next »