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

mist none at none.none
Fri Jan 25 02:56:13 PST 2013


On Friday, 25 January 2013 at 05:35:19 UTC, kenji hara wrote:
> module abc;
> @property int foo(int n);
>
> void main() {
>   foo = 1;  // top-level property setter
>   1.foo;  // property getter with UFCS
> }
>
> We cannot distinguish the two usages without adding any new 
> features.
>
> Kenji Hara

"1.foo" must be compile error here. Makes as much sense as

int a;
void main() {
     1.a;
}

Property must behave exactly like data or it is not a property.


More information about the Digitalmars-d mailing list