Closed setop closed 1 year ago
Just use Python's implicit line continuation inside parentheses, the same way you would for any other long sequence of Python operators:
(
[1,2,3]
|> filter$(x -> (x & 1) == 1) # filter odd
|> list
|> len
|> print
)
That's awsome !
the same way you would for any other long sequence of Python operators
Honestly, I don't do that. I store intermediate results in local variables. Maybe not a best practice as it require to be pretty creative about naming... Hence my appeal for multi-line pipeline.
Maybe this notation could be explicitly stated in coconut examples, that's pretty elegant (to me at least :smile: ).
Instead of writing
[1,2,3] |> filter$(x -> (x & 1) == 1) |> list |> len |> print
I'd like to be able to write
As seen in Elixir
Currently if I try this, I get syntax error.