On 2012-08-04 22:53, Adam D. Ruppe wrote:

I did this and now I think this thing is almost done

===
int a;
@property int funcprop() {
         writeln("calling the getter and getting ", a);
     return a;
}
@property int funcprop(int s) {
     writeln("calling the setter with ", s);
     return a = s;
}
void main() {
     funcprop = 40;
     funcprop += 10;
}
===

run:

calling the setter with 40
calling the getter and getting 40
calling the setter with 50

Looks right to me. Now I just have to check for the @property tag on
some of these rewrites and then clean it up and test for a pull request.

BTW, how will this interact with overloaded operators and similar more advanced features? Say that I have a getter that returns a struct/class which overloads the += operator.

--
/Jacob Carlborg

Reply via email to