The Python version:<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">sum(item * item for item in sequence)</span></div>

</blockquote><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">can be translated to English as:</span></font></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">

<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">&quot;Sum of (item * item) foreach item in sequence&quot;</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br>

</span></font></div></blockquote><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">While the D version:</span></font><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">

<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><span class="Apple-style-span" style="border-collapse: separate; font-family: arial; ">reduce!(&quot;a+b&quot;)(map!(&quot;a*a&quot;)(sequence), 0);</span></span></font></div>

</blockquote>looks to me like:<blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>Reduce! a plus b map! a times a (sequence) (and a random 0 here).</div></blockquote>
<div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font><div><br><div class="gmail_quote">On Sun, Oct 3, 2010 at 12:59 PM, Andrei Alexandrescu <span dir="ltr">&lt;<a href="mailto:SeeWebsiteForEmail@erdani.org">SeeWebsiteForEmail@erdani.org</a>&gt;</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 10/03/2010 10:37 AM, bearophile wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Peter Alexander:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Out of curiosity, what syntax did you propose?<br>
</blockquote>
<br>
<a href="http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&amp;article_id=73868" target="_blank">http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&amp;article_id=73868</a><br>


<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
That said, the current D way of writing it isn&#39;t all that different<br>
from Python:<br>
<br>
return reduce!(&quot;a+b&quot;)(map!(&quot;a*a&quot;)(sequence), 0);<br>
</blockquote>
<br>
That&#39;s many times worse than the Python syntax.<br>
</blockquote>
<br></div>
This entails there&#39;s a way to measure that. How?<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Array/range comprehensions are syntax sugar, their point is to give<br>
something clean and readable that helps chunking:<br>
<a href="http://en.wikipedia.org/wiki/Chunking_%28psychology%29" target="_blank">http://en.wikipedia.org/wiki/Chunking_%28psychology%29</a><br>
</blockquote>
<br></div>
You&#39;d need to bring a pointer to a document that confirms that (and how) array and range comprehensions have helping chunking as their point. I googled for<br>
<br>
array comprehensions help chunking<br>
<br>
to no avail.<br><font color="#888888">
<br>
<br>
Andrei<br>
</font></blockquote></div><br></div></div></div>