On Fri, Jun 21, 2013 at 4:02 PM, Ali Çehreli <span dir="ltr"><<a href="mailto:acehreli@yahoo.com" target="_blank">acehreli@yahoo.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 06/21/2013 03:57 PM, Diggory wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Friday, 21 June 2013 at 22:56:04 UTC, Andrei Alexandrescu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 6/21/13 3:55 PM, Andrei Alexandrescu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 6/21/13 3:45 PM, Timothee Cour wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'd like to support N-ary map, ie std.algorithm.map that takes 1 or<br>
more<br>
ranges as arguments and operates lazily on those.<br>
</blockquote></blockquote></blockquote></blockquote>
<br>
</div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You can use "zip" from std.range.<br>
</blockquote>
<br></div>
Timothee specifically said that he is trying to avoid zip: :)<div class="HOEnZb"><div class="h5"><br>
<br>
> before:<br>
>   zip(a,b).map!(u=>absDiff(u[0],<u></u>u[1])).reduce!fun;<br>
> after:<br>
>   map!absDiff(a,b).reduce!fun;<br>
<br></div></div><span class="HOEnZb"><font color="#888888">
Ali<br>
</font></span></blockquote></div><br><div>also works great with string lambdas:</div><div>eg: dotproduct:</div><div><br></div><div>before:<br>  zip(u,v).map!"a[0]*a[1]".reduce!"a+b";<br>after:<br>  map!"a*b"(u,v).reduce!"a+b";</div>
<div><br></div><div>=> clearer, and provides more room for optimizaton</div><div><br></div>