<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2013/1/25 Jonathan M Davis <span dir="ltr"><<a href="mailto:jmdavisProg@gmx.com" target="_blank">jmdavisProg@gmx.com</a>></span><br><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><div class="h5">And actually, something far more important than any of those reasons is the<br></div></div>
issue of setters. We've focused most of this discussion on optional parens and<br>
the situation with getter properties, but setter properties and their issues<br>
are also important. Would you want code like this to compile?<br>
<br>
range.popFront = 17;<br>
container.linearRemove = range;<br>
path.baseName = ".xyz";<br>
str.icmp = "hello";<br>
enforce(a == b) = "msg";<br>
arr.sameHead = arr2;<br>
<br>
With @property, we can restrict the functions which can be used with the<br>
setter syntax to functions where that makes sense. Without it, all kinds of<br>
ridiculous code like the code above would be allowed.<br>
<br>
Allowing optional parens is one thing, but conflating that with properties is<br>
something else entirely. Property functions are not just functions which are<br>
called without parens, and we shouldn't act like they are.</blockquote><div><br></div><div>I have explained an additional rule in #1a.</div><div><br></div><div style="font-family:arial,sans-serif;font-size:14px">> 1a. Optional parentheses for normal functions is just allowed for the getter usage.</div>
<div style="font-family:arial,sans-serif;font-size:14px">>  <br></div><div style="font-family:arial,sans-serif;font-size:14px">> int foo();</div><div style="font-family:arial,sans-serif;font-size:14px">> foo(); // ok<br>
</div><div style="font-family:arial,sans-serif;font-size:14px">> foo; // ok,  from #1</div><div style="font-family:arial,sans-serif;font-size:14px">>  <br></div><div style="font-family:arial,sans-serif;font-size:14px">
> void bar(int);<br></div><div style="font-family:arial,sans-serif;font-size:14px">> bar(1); // ok</div><div style="font-family:arial,sans-serif;font-size:14px">> bar = 1;  // disallowed, from #1a</div><div class="" style="font-family:arial,sans-serif;font-size:14px">
<br class=""></div><div> If based on that, such situations which you are worried will not occur.</div><div><br></div><div>Kenji Hara</div></div></div></div>