On Wednesday, 23 January 2013 at 22:07:30 UTC, Timon Gehr wrote:
IIRC Adam likes to have both fun = value and fun(value) available for the same function.

Yeah, it is sometimes useful for methods that can be both chained and assigned:

foo.bar(10).baz("hello");

vs

foo.bar = 10;
foo.baz = "hello";


...and sometimes just as a quick convenience when hunting bugs (yup, I'm kinda for writeln = str; because you can throw that in without hunting for the end of the expression to put in the close paren.



I see no reason to change the current behavior for non-@property.

Now, for @property setters, we might use them for other operations too.

@property int a() { return 10; }
@property void a(int v) { ... }

a += 10;

should be transformed into a(a() + 10); which is not currently done.

Reply via email to