<div class="gmail_quote">On 9 April 2012 03:25, Andrei Alexandrescu <span dir="ltr"><<a href="mailto:SeeWebsiteForEmail@erdani.org">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">
<div class="im">On 4/8/12 7:21 PM, Andrej Mitrovic wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 4/9/12, Andrei Alexandrescu<<a href="mailto:SeeWebsiteForEmail@erdani.org" target="_blank">SeeWebsiteForEmai<u></u>l@erdani.org</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
and pass-by-alias<br>
</blockquote>
<br>
Speaking of alias, one killer feature would be to enable using alias<br>
for expressions. E.g.:<br>
<br>
struct Window { struct Point { int x, y; } Point point; }<br>
void test() {<br>
Window window;<br>
alias window.point.x x;<br>
// use 'x' here which is really window.point.x<br>
}<br>
</blockquote>
<br></div>
Yah, we should add that at some point. Walter and I discussed about it and it's virtually approved. But to be on the conservative side, it's not for expressions but for mere pointer-chasing chains.</blockquote><div>
<br></div><div>Why use alias, instead of allowing 'ref' on local declarations?</div><div>The alias approach suffers from complications when referencing a complex expression. Particularly if that expression involves a non-pure function call. A local ref would seem less problematic to me?</div>
</div>