Closed rkrx closed 7 years ago
What would the behavior be? Prepend the first argument only? How would it know which argument should be pipled into (I'm ok with saying only first argument, just should be explicit).
Yes, I would say so.
All signatures of functions and methods are expected to have a reasonable parameter-order. Always having a pipable parameter at a specific position makes it easier and more fluent to use a language in other situations as well, as this could be used as a mnemonic.
Implemented!
How did you priorize the precedence rules in the praser?
For example: What happens if I write something like 2 + 3 |> mul(3)
?
Will this translate to mul(2 + 3, 3)
or 2 + mul(3, 3)
?
Currently, it has a quite high precedence. Meaning that 2 + 3 |> mul(3)
is interpreted as 2 + mul(3, 3)
.
But overall need to take a pass at precedence overall, just kinda making it work for now...
Implement a pipe operator like in elixir.
Language symbol
|>
may differ.