<div dir="ltr">Sorry, forgot the @property.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Feb 3, 2013 at 12:27 PM, Gor Gyolchanyan <span dir="ltr"><<a href="mailto:gor.f.gyolchanyan@gmail.com" target="_blank">gor.f.gyolchanyan@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I always wondered if there's a good way to incorporate opOpAssign family of operators with the write property syntax.<div>
Currently, using anything but the direct assignment fails, so even if eventually the support for defining specific opOpAssign for properties won't be implemented, at least the automatic rewrite of them would be nice:</div>

<div><br></div><div>struct A</div><div>{</div><div>public:</div><div>    int i()</div><div>    {</div><div>        return _i;</div><div>    }</div><div><br></div><div>
    int i(int i_)</div><div>    {</div><div>        return _i = i_;</div><div>    }</div><div><br></div><div>private:</div><div><div>    int _i;</div></div><div>}</div><div>
<br></div><div>unittest<br>{</div><div>    A a;</div><div>    a.i += 2; // a.i(a.i() + 2);<br>}</div></div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Sun, Feb 3, 2013 at 12:16 PM, Andrei Alexandrescu <span dir="ltr"><<a href="mailto:SeeWebsiteForEmail@erdani.org" target="_blank">SeeWebsiteForEmail@erdani.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Walter and I have had a discussion on how to finalize properties.<br>
<br>
<a href="http://wiki.dlang.org/DIP23" target="_blank">http://wiki.dlang.org/DIP23</a><br>
<br>
We got input from DIP21 (which we didn't want to clobber, hence the new DIP) and the recent discussion.<br>
<br>
The proposal probably won't be accepted in its current form because it breaks some code. We hope to bring it to good shape with everyone's help.<br>
<br>
In brief:<br>
<br>
* Optional parens stay.<br>
<br>
* Just mentioning a function or method without parens does NOT automatically take its address. (This is a change from the current behavior.)<br>
<br>
* Read properties (using @property) work as expected with the mention that they may NOT be called with the parens. Any parens would apply to the returned value.<br>
<br>
* Write properties (using @property) may only be used in the assignment form (no function-style call allowed).<br>
<br>
It is understood that the current proposal is just a draft and there must be quite a few corner cases it doesn't discuss. We also understand it's impossible to reconcile all viewpoints and please all tastes. Our hope is to get to a point where the rules are self-consistent, meaningful, and complete.<br>


<br>
<br>
Destroy.<span><font color="#888888"><br>
<br>
Andrei<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br>Bye,<br>Gor Gyolchanyan.
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Bye,<br>Gor Gyolchanyan.
</div>