@autocall aka property for the millionth time

Adam D. Ruppe destructionator at gmail.com
Thu Jul 4 09:06:34 PDT 2013


On Thursday, 4 July 2013 at 15:37:42 UTC, Timon Gehr wrote:
> Doesn't work with type deduction.

meh, like I said, in the places I want this for myself, I'm using 
a custom struct anyway, so no worry there. In cases that return 
ints and strings, the optional parenthesis and a=5 rewrite to 
a(5) syntax is good enough for me, with the sole exception of the 
opOpAssign family of functions (a.prop += 5), and I've just 
learned to avoid doing that over the years.

> What about keeping @property for setters and using @autocall 
> for getters to get rid of all the ambiguity?

That was my first attempt (doing the @autocall rewrite with 
@property functions), but I failed to implement it because 
overload resolution and other difficulties.

Perhaps being different attributes would help make that easier 
though.


More information about the Digitalmars-d mailing list