On Thu, Jul 2, 2020 at 12:26 PM Dan Ackroyd <dan...@basereality.com> wrote:

> On Wed, 1 Jul 2020 at 20:40, Larry Garfield <la...@garfieldtech.com>
> wrote:
>
> > it would also offer a way to do effectively the same thing
>
> One use-case that would need to be covered for that would be for
> callables where you don't know how many parameters there would be in
> the callable.
>
> > duplicate functionality needlessly.
>
> Good chance it might still be nice. Not only is the syntax a little
> bit nicer imo:
>
> // For some class
> class Foo {
>     public static function quux() {
>         echo "I am quux";
>     }
> }
>
> // Partial version
> [Foo::class, 'quux'](?);
>
> // Dedicated version
> $(Foo, quux);
>
> As I find it easier to read, but also avoiding using strings to
> reference functions/classes is probably less ambiguous for both humans
> and computers.
>

The partial function application version would be Foo::quux(?). That is,
looks just like a normal call, but with placeholders. Your version would of
course also work, but I'm not sure why someone would want to write it in
that particular way :)

Regards,
Nikita

Reply via email to