<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: foreach syntax</title>
	<atom:link href="http://www.databasesandlife.com/foreach-syntax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.databasesandlife.com/foreach-syntax/</link>
	<description>Adrian Smith's blog</description>
	<lastBuildDate>Fri, 03 Feb 2012 15:43:22 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Flo Ledermann</title>
		<link>http://www.databasesandlife.com/foreach-syntax/comment-page-1/#comment-11059</link>
		<dc:creator>Flo Ledermann</dc:creator>
		<pubDate>Fri, 26 Mar 2010 17:25:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.databasesandlife.com/?p=442#comment-11059</guid>
		<description>You can add Python (where I am doing most of my work nowadays) with yet another slightly different syntax:

&lt;code&gt;
for &lt;em&gt;element&lt;/em&gt; in &lt;em&gt;list&lt;/em&gt;:
&lt;/code&gt;

Btw: Python does not even know a C-style for loop, you can only iterate over lists there. An C-style for loop would be

&lt;code&gt;
for &lt;em&gt;i&lt;/em&gt; in range(&lt;em&gt;n&lt;/em&gt;):
&lt;/code&gt;

Concerning the semantics of &lt;em&gt;for&lt;/em&gt; vs. &lt;em&gt;foreach&lt;/em&gt;: I believe in mathematics, when talking about sets you say &quot;for all x in Y&quot;, this even has a distinct sign (&#8704;) - so &quot;for&quot; really is short for &quot;for all&quot;, not &quot;for each&quot; for people who have a math background.</description>
		<content:encoded><![CDATA[<p>You can add Python (where I am doing most of my work nowadays) with yet another slightly different syntax:</p>
<p><code><br />
for <em>element</em> in <em>list</em>:<br />
</code></p>
<p>Btw: Python does not even know a C-style for loop, you can only iterate over lists there. An C-style for loop would be</p>
<p><code><br />
for <em>i</em> in range(<em>n</em>):<br />
</code></p>
<p>Concerning the semantics of <em>for</em> vs. <em>foreach</em>: I believe in mathematics, when talking about sets you say &#8220;for all x in Y&#8221;, this even has a distinct sign (&forall;) &#8211; so &#8220;for&#8221; really is short for &#8220;for all&#8221;, not &#8220;for each&#8221; for people who have a math background.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://www.databasesandlife.com/foreach-syntax/comment-page-1/#comment-11029</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Wed, 24 Mar 2010 14:35:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.databasesandlife.com/?p=442#comment-11029</guid>
		<description>BTW, there&#039;s `for each ... in` since JS 1.6, see: 
https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Statements/for_each...in :)</description>
		<content:encoded><![CDATA[<p>BTW, there&#8217;s `for each &#8230; in` since JS 1.6, see:<br />
<a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Statements/for_each...in" rel="nofollow">https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Statements/for_each&#8230;in</a> :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

