Rant after trying Rust a bit
Jonathan M Davis via Digitalmars-d
digitalmars-d at puremagic.com
Fri Jul 24 14:29:55 PDT 2015
On Friday, 24 July 2015 at 20:46:07 UTC, Tofu Ninja wrote:
> Is omitting the () not part of ufcs? Or does it have some other
> name, I can never remember.
No. That's simply omitting the parens from a function call that
has no arguments. If it has a name, it's just "optional parens."
Universal Function Call Syntax is the syntax that allows you to
call a free function as if it were a member function, which is
why stuff like
auto result = myRange.find(bar);
works. It _does_ mean that you can drop even more parens, because
the first function argument is now to the left of the dot, and
the parens are then empty if there was only one function
argument, but being able to drop the parens has nothing to do
with UFCS. We could still have UFCS and yet never be able to drop
parens.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list