pipethread is a module by rkeene that implements thread-based concurrency and parallelism. It gives you the | from sh in Tcl, for Tcl code.
Tcl 2016 Presentation:
proc a {inchan outchan} { puts $outchan blah } pipethread::pipe a | { gets $inchan line; puts $outchan "[string length $line]:$line" } set output [pipethread::pipe exec ls | foreach line { puts $outchan "-->$line<--" }] pipethread::pipe -outchan stdout -- exec ls | foreach line { puts $outchan "-->$line<--" }
PYK {2016 07 24}: SCSH is a related contraption for Scheme.