Allowing the object.method(args...) syntax as an alias for method(object, args ...)

That’s indeed useful, and pipes already give the ability.

That often requires putting the “main” argument as the last function argument, not the first. Think of common data manipulation functions map/filter/mapreduce/etc: they wouldn’t be convenient with your proposal.
Meanwhile, one can use a helper piping package, for example with DataPipes:

@p X |> filter(isodd) |> map(log) |> findmax(abs)
@p "Hello, world!" |> split(__, ",") |> replace.(__, "o"=>"e") |> join(__, ":")

Autocomplete relates to tooling, not the language syntax itself. It doesn’t seem fundamentally more difficult to autocomplete x |> (tab) than x..(tab), the assumption of a specific “main” argument position is there either way.

1 Like