Re: pipes, scalar objects and on?
| From: | Olle Härstedt | Date: | Mon, 17 Jul 2023 14:57:48 +0000 |
| Subject: | Re: pipes, scalar objects and on? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-120825@lists.php.net to get a copy of this message | ||
2023-07-17 14:25 GMT+02:00, Karoly Negyesi <karoly@negyesi.net>:
> Hi,
>
> I tried to read on why the pipe RFC failed but by and large I also failed.
>
> The discussion on https://github.com/php/php-src/pull/7214 is
> very short.
>
> https://externals.io/message/114770 is not so short but it
> seems not to
> cover the latest version which uses first class functions?
>
> Could someone please give me a summary why it failed? I really would like
> to see it succeed :) I am writing code if not daily but certainly weekly
> that certainly looks like a pipeline.
The pipe RFC was kinda forced in before a deadline, no?
My own two cents:
* It's trivial to implement a pipe() function or a Pipe class
* A Pipe class is better than both a function and built-in operator,
since it can be configured with custom behaviour, e.g. stop or throw
on empty payload, or repeat on a collection, or even with parallelism
or concurrency
* If I had voting rights, I'd vote in favor in a pipe operator :)
Olle