News for hackers. Stuff that matters.
Re:How are Unix pipes implemented? by RocketSyntax on Friday March 27, 2020 @05:12PM (#22706957)
I'd greatly appreciate pipes in the next version of Python. Pandas is huge now, and the R programming language has implemented this for its dataframes. There are Python packages for this, but they were buggy for me.
Re:How are Unix pipes implemented? by doubleunplussed on Friday March 27, 2020 @05:19PM (#22707001)
What would that mean? Just an extra syntax for passing like, the output of one iterator to a function that accepts an iterable as input? Like, syntactic sugar for:

foo = qux(bar(foo(x)))

Re:How are Unix pipes implemented? by RocketSyntax on Friday March 27, 2020 @05:41PM (#22707170)
my_df %>% plot(col1,col2,col3)

see 18.2.1 and 18.2.4 in https://r4ds.had.co.nz/pipes.html

much sugar

Re:How are Unix pipes implemented? by mellavora on Friday March 27, 2020 @06:05PM (#22707339)
too much sugar can make your code diabetic.

pipes are cool until they aren't

Re:How are Unix pipes implemented? by ktpsns on Friday March 27, 2020 @07:08PM (#22707709)
The %>% notation might not be very short, but there are other short ways of avoiding parenthesis mess as in foo = qux(bar(foo(x))). For instance, Mathematica/Wolfram language allows you to write something basically

     foo = qux @ bar @ foo(x)
which resembles the function composition operator in mathematics (https://en.wikipedia.org/wiki/Function_composition). Piping is basically the reverse notation, i.e. foo = foo(x) | bar | qux.