4 ms·
has there been proposals/research on having non linear / branching pipe syntax ? a |1 b | c | d, |1 e aka piping a to both b,c,d and e branches ?
by agumonkey 8y ago
has there been proposals/research on having non linear / branching pipe syntax ?
a |1 b | c | d, |1 e
aka piping a to both b,c,d and e branches ?
- deleted 8y ago[deleted]
- masklinn 8y agoSmalltalk's "method cascading" (the `;` operator) did roughly that. I don't think you're forking an entire sequence of methods though, it just allows performing operations on the same root object e.g. a foo ; bar ; baz would sequentially send "foo", "bar" then "baz" to "a", then would return the result of the last call. The ability to fork iterators (which may be the semantics you're actually interested in) also exists in some languages e.g. Python (itertools.tee) or Rust (some iterators are clonable)
- gpderetta 8y agotee ? edit: a | tee >(b | c | d) | e
- agumonkey 8y agoprobably the closest solution.. thanks
- zeckalpha 8y agohttps://en.m.wikipedia.org/wiki/Named_pipe https://en.m.wikipedia.org/wiki/Named_pipe
- agumonkey 8y agothat's a building block, not a good ~interface. Kinda like redirections before pipe were added to shells
- leni536 8y agoI've seen an idea of a generic utility that does this on moreutils' main page[1]. Search for 'connect'. [1] https://joeyh.name/code/moreutils/ https://joeyh.name/code/moreutils/
- AnIdiotOnTheNet 8y agoI don't think the commandline is well suited to constructing or reading anything more complicated than a linear pipe. What you'd want for that kind of workflow is a 2d layout.
- agumonkey 8y agoThat's actually the question underneath.. can we write simple graphs on a command line :)
- deleted 8y ago[deleted]