@property - take it behind the woodshed and shoot it?
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Thu Jan 24 18:01:33 PST 2013
On 1/24/13 7:41 PM, kenji hara wrote:
> I think that the "optional parentheses" feature for normal functions
> should always work in _shallowly_. Even if a function returns some
> callable object, "optional parentheses" should not applied to the return
> object recursively.
>
> That means:
> void delegate() foo() { ... }
> void main() {
> auto x = foo(); // typeof(x) == void delegate()
> auto y = foo; // typeof(y) == void delegate()
> }
>
> Kenji Hara
Interesting, so that would mean if anyone ever wants to get the delegate
AND call it in one shot would need to write: foo()().
I think this proposal has merit.
Andrei
More information about the Digitalmars-d
mailing list