<div dir="ltr">2013/2/4 Andrei Alexandrescu <span dir="ltr"><<a href="mailto:SeeWebsiteForEmail@erdani.org" target="_blank">SeeWebsiteForEmail@erdani.org</a>></span><br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im"><br></div>
Couldn't AddressOf use "&(" + exp + ")"?<br></blockquote><div><br></div><div>Yes. It's enough. I wanted to explain that "we should treat address-expression carefully".</div><div>
 <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
I thought more about this. The problem remains even without @property, due to optional parens in function invocation. Consider:<br>
<br>
ref int fun() { ... }<br>
auto p1 = &fun;<br>
auto p2 = &(fun);<br>
auto p3 = &(fun());<br>
<br>
What are the types of the three? The optional parens in invocation require some disambiguation. I think the sensible disambiguation is to have &fun take the address of fun and the other two take the address of fun's result.<br>
</blockquote><div><br></div><div style>Agreed.</div><div style> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

I would agree restricting the properties, but requiring a __trait to take the address of a regular function or method seems overkill.</blockquote><div><br></div><div style>Fully agreed.</div><div style><br></div><div style>
Although it looks strange and unstable, adding new distinction of semantics between &foo and &(foo) has no ambiguity.</div><div style><br></div><div style>I think this is necessary feature for the D's function and property semantics.</div>
<div style><br></div><div style>Kenji Hara</div></div></div></div>