I am glad that someone is working on a new stream processing language, it is a very interesting paradigm. However I hope that they provide some very robust tools for controlling input splitting. As I have spent too much time fighting with awk and wishing it was more flexible(it is frustrating always having exactly two levels of splitting with only matchers on the first and only inverse splitting on the second). As is…
> However I hope that they provide some very robust tools for controlling input splitting Yes, splitting and combining. Looking at the code example, I feel like so much opportunity is just being squandered, where something like Rust's mapping constructs would feel so much better. Yours is definitely more in that vein, here's something a little closer: STDIN | /\w+/{|word| /house/ => "foo" /car/ => "bar" "literal" =>…
STDIN | /\w+/ | {|each match|
/house/ => "foo"
/car/ => "bar"
"literal" => "baz"
_ => "dib"
}
Where "each x" in a parameter list wraps the body in a map and uses x as the loop variable, and "match" in a parameter list instructs that this is the parameter we are doing pattern matching on in the body (no need to name it).I think this is a more flexible solution, and more modifiers than each could be introduced. For instance, sum of squares could be:
seq(100) | {|each x| x * x} | {|reduce (x = 0, y)| x + y}