On 1/24/13 3:57 AM, Jacob Carlborg wrote:
On 2013-01-24 09:34, Walter Bright wrote:
This has turned into a monster. We've taken 2 or 3 wrong turns somewhere.

Perhaps we should revert to a simple set of rules.

1. Empty parens are optional. If there is an ambiguity with the return
value taking (), the () go on the return value.

2. the:
f = g
rewrite to:
f(g)
only happens if f is a function that only has overloads for () and (one
argument). No variadics.

What do you mean by: "overloads for ()"?

That means there must be two overloads of f exactly:

T f();
f(T);

3. Parens are required for calling delegates or function pointers.

4. No more @property.

So:

void delegate () foo ();

foo() // would call the delegate ?

Yes.

a = foo; // fetch the delegate
b = foo(); // fetch and invoke the delegate


Andrei

Reply via email to