<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="http://tech.saigonist.com/taxonomy/term/79/all" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>functional</title>
    <link>http://tech.saigonist.com/taxonomy/term/79/all</link>
    <description></description>
    <language>en</language>
          <item>
    <title>Python-like List Comprehensions in JavaScript</title>
    <link>http://tech.saigonist.com/b/code/python-list-comprehensions-javascript</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;March 4, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/javascript&quot;&gt;javascript&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/es6&quot;&gt;es6&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/python&quot;&gt;python&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/functional&quot;&gt;functional&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/lambda&quot;&gt;lambda&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;Python has a neat syntactic feature where you can take a literal list constructor&#039;s bracket notation (e.g. &lt;code&gt;[2, 4, 6, 8, 10]&lt;/code&gt;) but have code statements generate the list&#039;s contents. So instead of writing out the 5 even numbers in the example, one could write &lt;code&gt;[(x+1)*2 for x in range(5)]&lt;/code&gt; which turns out to be more characters but you can imagine the savings if the series in the list was longer. Instead of &lt;code&gt;range()&lt;/code&gt; we could have a literal list &lt;code&gt;[0, 1, 2, 3, 4]&lt;/code&gt; or even a generator function, anything which is iterable.&lt;/p&gt;

&lt;p&gt;How could we do this...&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Thu, 03 Mar 2016 17:19:43 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">51 at http://tech.saigonist.com</guid>
  </item>
  <item>
    <title>List Comprehensions in PHP (how to emulate Python)</title>
    <link>http://tech.saigonist.com/b/code/list-comprehensions-php-how-emulate-python</link>
    <description>&lt;span class=&quot;submitted-by&quot;&gt;March 4, 2016&lt;/span&gt;&lt;div class=&quot;field_tags&quot;&gt;&lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/php&quot;&gt;php&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/python&quot;&gt;python&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/functional&quot;&gt;functional&lt;/a&gt;&lt;/span&gt; &lt;span class=&quot;label label-info&quot;&gt;&lt;a href=&quot;/tags/lambda&quot;&gt;lambda&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;field field-name-body field-type-text-with-summary field-label-hidden&quot;&gt;&lt;div class=&quot;field-items&quot;&gt;&lt;div class=&quot;field-item even&quot;&gt;&lt;p&gt;Python has a sweet syntactic feature where you can take a literal list written out in bracket notation (e.g. &lt;code&gt;[1, 3, 5, 7, 9]&lt;/code&gt;) but have inline expressions generate the list&#039;s contents. So instead of writing out the 5 consecutive odd numbers like above, in Python we can say &lt;code&gt;[(x*2+1 for x in range(5)]&lt;/code&gt; which turns out to be more characters but you can imagine the savings if the series in the list was longer and not just odd. Instead of &lt;code&gt;range()&lt;/code&gt; we could have a literal list &lt;code&gt;[0, 1, 2, 3, 4]&lt;/code&gt; or even a generator function, anything which is...&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description>
     <pubDate>Thu, 03 Mar 2016 17:17:00 +0000</pubDate>
 <dc:creator>tomo</dc:creator>
 <guid isPermaLink="false">50 at http://tech.saigonist.com</guid>
  </item>
  </channel>
</rss>
