holymer icon indicating copy to clipboard operation
holymer copied to clipboard

Optional Hole (`_`) in piping

Open azur1s opened this issue 2 years ago • 0 comments

current piping syntax

fun main: int = do
    "Hello, World!\n"
    |> @write(_);
    return 69;
end;

The _ (Hole) is required by default, maybe it will be a quality-of-life improvement if we can make it optional, something like on default it will assume _ is on the first one, for example:

(assuming foo() takes 2 argument)

"Hello, World!\n"
|> foo(_, 1);

is the same as

"Hello, World!\n"
|> foo(1);

This should be pretty easy and might improve the quality-of-life by a lot.

azur1s avatar Mar 13 '22 10:03 azur1s