@property - take it behind the woodshed and shoot it?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Jan 24 18:13:07 PST 2013


On 1/24/13 8:27 PM, kenji hara wrote:
> I have thought an additional idea.
> If we really want a feature to disable optional parentheses for normal
> functions, we can add @function attribute to the language spec.
>
> int foo();
> @property int bar();
> @function int baz();  // new!
>
> int x1 = foo();  // ok
> int x2 = foo;  // optional parentheses, allowed
> int y1 = bar();  // disallowed, calling int is meaningless
> int y2 = bar;  // ok
> int z1 = baz();  // ok
> int z2 = baz;  // *disallowed* by @function attribute
>
> How about?
>
> Kenji Hara

Brings completeness. But at this point I'm inclined to simplify, 
simplify, simplify. Your #1 proposal to ratify current behavior and 
never apply "()" deeply is very sensible. If we also find a simple way 
to implement writing for properties we may be able to eliminate 
@property entirely.

Andrei


More information about the Digitalmars-d mailing list