Nim pipeline operator in one line
template `|>` (x, f: auto): auto = f(x)
With that you can write code like:
5 |> increment |> square
Altough you can still write it like this:
5.increment.square
But the pipeline operator looks nicer :D
Nim pipeline operator in one line
template `|>` (x, f: auto): auto = f(x)
With that you can write code like:
5 |> increment |> square
Altough you can still write it like this:
5.increment.square
But the pipeline operator looks nicer :D