Re: [PHP-DEV] First-class callable partial application

2023-03-10 Thread Christian Schneider
Am 10.03.2023 um 20:04 schrieb Eugene Sidelnyk : > Another simplified example: > > ``` > // partial application > foo(bar(1, ...)); While it is not as concise as your version I think the work-around with short arrow functions works ok unless your code is full of partial applications: foo

Re: [PHP-DEV] First-class callable partial application

2023-03-10 Thread Larry Garfield
On Fri, Mar 10, 2023, at 2:16 PM, Eugene Sidelnyk wrote: > I glanced over this RFC and suggested syntax has question marks. Each one > stands for a single parameter. > > Since there are named arguments already, it seems to be redundant. We'd > rather pass couple of named arguments and place the ...

Re: [PHP-DEV] First-class callable partial application

2023-03-10 Thread Eugene Sidelnyk
I glanced over this RFC and suggested syntax has question marks. Each one stands for a single parameter. Since there are named arguments already, it seems to be redundant. We'd rather pass couple of named arguments and place the ... construction at the ending than twirl around with question marks

Re: [PHP-DEV] First-class callable partial application

2023-03-10 Thread Larry Garfield
On Fri, Mar 10, 2023, at 1:04 PM, Eugene Sidelnyk wrote: > Hello internals! > I'm just wondering why First class callable syntax doesn't allow partial > application? > Recently I stumbled across following scenario where it could be really > useful: > > ``` > public function __invoke(SendOtpComm

Re: [PHP-DEV] RFC: code optimizations

2023-03-10 Thread Eugene Sidelnyk
Seems Uncle Bob with his boy scout rule left the room... On Fri, Mar 10, 2023, 2:19 PM Max Kellermann wrote: > On 2023/03/01 13:15, Max Kellermann wrote: > > IMO this is a bug in the process, and I'm trying to fix it. It should > > be allowed to merge small incremental improvements without a d

[PHP-DEV] First-class callable partial application

2023-03-10 Thread Eugene Sidelnyk
Hello internals! I'm just wondering why First class callable syntax doesn't allow partial application? Recently I stumbled across following scenario where it could be really useful: ``` public function __invoke(SendOtpCommand $command) { $this->cache->get($command->getPhone(), $thi

Re: [PHP-DEV] RFC: code optimizations

2023-03-10 Thread Max Kellermann
On 2023/03/01 13:15, Max Kellermann wrote: > IMO this is a bug in the process, and I'm trying to fix it. It should > be allowed to merge small incremental improvements without a dedicated > RFC. > > This is the first draft of my RFC: > https://wiki.php.net/rfc/code_optimizations My RFC draft i