<div class="gmail_quote">On 15 March 2012 19:05, 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">
On 3/15/12 11:30 AM, Manu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 15 March 2012 17:32, Andrei Alexandrescu<br>
<<a href="mailto:SeeWebsiteForEmail@erdani.org" target="_blank">SeeWebsiteForEmail@erdani.org</a> <mailto:<a href="mailto:SeeWebsiteForEmail@erdani.org" target="_blank">SeeWebsiteForEmail@<u></u>erdani.org</a>>><div class="im">
<br>
wrote:<br>
    One note - the code is really ingenious, but I still prefer swap()<br>
    in this case. It's more concise and does less work in the general case.<br>
<br>
    swap(a[i + k], a[j + j]);<br>
<br>
    only computes the indexing once (in source, too).<br>
<br>
<br></div><div class="im">
It all still feels to me like a generally ugly hack around the original<br>
example:<br>
   a,b = b,a;<br>
</div></blockquote>
<br>
It's a function call. Why is a function call a ugly hack?<br></blockquote><div><br></div><div>Because now we're involving libraries to perform a trivial assignment.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It's also more verbose. Compare<br>
<br>
swap(a[i + k], a[i + j]);<br>
<br>
with<br>
<br>
a[i + k], a[i + j] = a[i + j], a[i + k];<br>
<br>
I mean one could even easily miss a typo in there.<br></blockquote><div><br></div><div>That's fair, and in that case you might want to call such a function. But I think that's very contrived.</div><div>I can't remember the last time I ever wanted to perform a swap on anything other than stack primitives.</div>
<div>Also I think this (and perhaps more so MRV) will find a very major use case in maths code, and maths code tends to revolve around simple (often single letter) maths-y type variable names.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
There's also semantic issues to be defined. What is the order of evaluation in<br>
<br>
f(), g() = h(), k();<br>
<br>
?<br></blockquote><div><br></div><div>Left to right, clearly. Keep it simple.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">All of this adds dead weight to the language. We shouldn't reach to new syntax for every single little thing.</blockquote>
<div><br></div><div>MRV is not 'every single little thing'. I'd say it's the single major checklist item that D just doesn't tick (and perhaps user attributes, although there's no resistance there, it's just not done yet).</div>
<div>I get the impression I'm not the only one here that feels that way too. I'm perhaps just louder, and more annoying :)</div></div>