On Friday, 22 November 2013 at 07:37:11 UTC, Kenji Hara wrote:
2013/11/22 deadalnix <[email protected]>

On Friday, 22 November 2013 at 04:33:56 UTC, Kenji Hara wrote:

After removing 'function' concept, 'func' always means function pointer or delegate. So we cannot call functions without parenthesis anymore. It is unacceptable change to me, and many D programmers would probably argue
same
thing.


It removes all ambiguities.

Optional parentheses are still an option when they aren't ambiguous.

void foo() {}

foo; // Can still call foo if we want to.


It will introduce a new ambiguity. See below example.

int foo();
void test(int function() fp);
void test(int num);

void main() {
    test(foo);  // which test is called?
}

Kenji Hara

The first one.

Note that optional () is ambiguous by definition - the word optional convey this very idea. The ambiguity introduced by optional () must not be conflated by the one introduced by the existence of non first class function.

You stated that the existence of function is necessary for optional parentheses to exist, and I showed you that it is false. Nothing more, nothing less.

Reply via email to