Does it sound good?

class X
{
   double x;
   @property X foo(double y) { x = y; return this; }

   @property X bar(double y) { x = y + 5; return this; }
}

void main()
{
        X x = new X();
        x.foo(3).bar(4);
}


It sort of emulates UFCS but I'm not sure if it's more trouble than it's worth.


I figure it would be better than just returning void as it provides the option to chain but not sure if it will come back to bite me.



Reply via email to