Re: pipes, scalar objects and on?

From: Date: Tue, 18 Jul 2023 16:50:31 +0000
Subject: Re: pipes, scalar objects and on?
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-120842@lists.php.net to get a copy of this message
On Tue, Jul 18, 2023, at 4:47 PM, Olle Härstedt wrote: > Any comment on a pipe (or piped process) as a first-class value? When > you use |> the functions are immediately applied, which might not be > what you want. You can lazify it by wrapping it in a lambda, but I > think that decreases the value of the pipe concept in itself. One > strength is the ability to split the decision about what to glue > together from the decision on how to execute it. You kinda get some > light-weight metaprogramming ability that way. > > Well i guess such a pipe-concept is pretty far removed from the simple > pipe operator. :) And also already possible with existing OOP > concepts, callable classes, and now the (...) syntax. That's the function concat operator I have been mentioning. Concat can be implemented in terms of pipe, and pipe can be implemented in terms of concat, but I'd rather have both natively. For more on my thoughts there, see: https://peakd.com/hive-168588/@crell/aoc2021-review --Larry Garfield

« previous php.internals (#120842) next »