rush
rush copied to clipboard
How about pass parameters to functions using >> ?
5 >> |x| x + 2 === 7
"-8" >> int & abs & |x| x / 2 >> sqrt === 2
("-8" >> int & abs, 2) >> |x, y| x + y >> z === 10
"1,2,3" >> split(",") & map(int & |x| x * 2) & join(",")
>> can be used to insert new arguments in the chain of process, assign value to the last variable. So it's operator precedence order is the same as equal sign.
I'm not sure if there is an obvious place for it in the operator precedence order. And if there isn't, then it'd be common to use parentheses for disambiguation, which doesn't make it all that different from a regular function call.
@Xion Updated my comment.