Uniform Function Call Syntax(UFCS) and @property

kenji hara k.hara.pg at gmail.com
Thu Mar 3 01:52:09 PST 2011


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?


More information about the Digitalmars-d mailing list