Re: [Vote] Pipe operator v2

From: Date: Tue, 20 Jul 2021 14:53:31 +0000
Subject: Re: [Vote] Pipe operator v2
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-115532@lists.php.net to get a copy of this message
2021-07-20 11:12 GMT+02:00, Marco Pivetta <ocramius@gmail.com>: > Hey Larry, > > On Sat, Jul 17, 2021 at 6:00 PM Larry Garfield <larry@garfieldtech.com> > wrote: > >> Hi Marco. Thank you for your explanation, even if I naturally disagree. >> >> Out of curiosity, what sort of additional >> power/capability/flexibility/etc. would, in your mind, justify pipe or >> similar being a native feature? PHP has a *ton* of native features that >> *could* be done in user space, or are simply syntax sugar, but still >> wildly >> popular and useful as native syntax. What is your heuristic for that? >> >> (The fact that there are 3-4 user space implementations of pipe-like >> behavior, all incompatible, is one of the reasons why I think >> standardizing >> it into a common core syntax *is* a good idea, though I know others >> disagree.) >> > > I think the pipe operator as a **custom** operator made sense when we had > the entire discussion around placeholder parameters ($$) to be > used in > the pipeline. > > As a plain "chain of functions with one input parameter and one output", it > makes little sense to have it as a custom construct, as it only adds > complexity to the AST. That is the idiomatic implementation, though. Hacklang is the odd man out with $$. Olle

« previous php.internals (#115532) next »