www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Uniform Function Call Syntax(UFCS) and property

The two semantics have no relation with each other.

My idea is that we allow 'this' keyword as the first parameter of free function:
----
T t;

void method(T)(ref T this){...}
--> t.method();
void method(T, A...)(ref T this, A args){...}
--> t.method(arg1, arg2);

 property bool empty(T)(ref T this){...}
--> if (t.empty){...}
 property void empty(T)(ref T this, bool f){...}
--> t.empty = true;
----

Do you think?
Mar 03 2011