Re: [RFC] Pipe Operator

From: Date: Tue, 03 May 2016 18:45:53 +0000
Subject: Re: [RFC] Pipe Operator
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-93046@lists.php.net to get a copy of this message
On Tue, May 3, 2016 at 11:36 AM, Fleshgrinder <php@fleshgrinder.com> wrote: > On 5/3/2016 8:12 PM, Sara Golemon wrote: >> The difference with scalar objects is: >> A) We need to agree on what methods these objects are going to have. >> ((And we won't agree)) >> > > The nice thing here is that we could start with the things that we agree > on and develop it from there further. > Which is precisely why we'll get paralyzed. > On 5/3/2016 8:12 PM, Sara Golemon wrote: >> We could maybe hedge our bets with a ->invoke(Callable) method that >> pushes the value into an arbitrary closure, but that's just adding >> complexity to... avoid adding complexity... o.O >> > > That would be pure evil. > Agreed. It's an attempt to force a square peg into a round hole. But focusing on OOP chaining will always leave this gap. > The pipe operator is also just a work around for poorly designed > libraries in this case and yields more poorly designed libraries. > Pretending that poorly designed libraries exist is naîve. PHP is dominated by poorly designed software but it manages to work because it responds with practicality. It's practical to provide a functional version of object method chaining. -Sara

« previous php.internals (#93046) next »