<?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: Ruby Block Scope</title>
	<atom:link href="http://railsforphp.com/2008/02/18/ruby-block-scope/feed/" rel="self" type="application/rss+xml" />
	<link>http://railsforphp.com/2008/02/18/ruby-block-scope/</link>
	<description></description>
	<lastBuildDate>Tue, 24 Aug 2010 18:20:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: The MIM</title>
		<link>http://railsforphp.com/2008/02/18/ruby-block-scope/comment-page-1/#comment-9804</link>
		<dc:creator>The MIM</dc:creator>
		<pubDate>Wed, 16 Sep 2009 15:42:27 +0000</pubDate>
		<guid isPermaLink="false">http://railsforphp.com/2008/02/18/ruby-block-scope/#comment-9804</guid>
		<description>minimal version:
f = nil
[&#039;apple&#039;, &#039;bannana&#039;, &#039;orange&#039;].each {&#124;f&#124; print &quot;#{f}, &quot;}; puts f</description>
		<content:encoded><![CDATA[<p>minimal version:<br />
f = nil<br />
['apple', 'bannana', 'orange'].each {|f| print &#8220;#{f}, &#8220;}; puts f</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://railsforphp.com/2008/02/18/ruby-block-scope/comment-page-1/#comment-6121</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Thu, 07 May 2009 08:49:55 +0000</pubDate>
		<guid isPermaLink="false">http://railsforphp.com/2008/02/18/ruby-block-scope/#comment-6121</guid>
		<description>fruit = %w[apple banana orange]
string = fruit.join(&#039;, &#039;)
puts &quot;#{string}, #{fruit.last}&quot;</description>
		<content:encoded><![CDATA[<p>fruit = %w[apple banana orange]<br />
string = fruit.join(&#8216;, &#8216;)<br />
puts &#8220;#{string}, #{fruit.last}&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rails for PHP Developers - Applying Ruby&#8217;s Blocks</title>
		<link>http://railsforphp.com/2008/02/18/ruby-block-scope/comment-page-1/#comment-1921</link>
		<dc:creator>Rails for PHP Developers - Applying Ruby&#8217;s Blocks</dc:creator>
		<pubDate>Tue, 09 Sep 2008 18:21:01 +0000</pubDate>
		<guid isPermaLink="false">http://railsforphp.com/2008/02/18/ruby-block-scope/#comment-1921</guid>
		<description>[...] long ago, we took a look at the basics of Ruby Block Scope. When you&#8217;re first getting started with Ruby&#8217;s blocks (closures), little things like [...]</description>
		<content:encoded><![CDATA[<p>[...] long ago, we took a look at the basics of Ruby Block Scope. When you&#8217;re first getting started with Ruby&#8217;s blocks (closures), little things like [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rafal Piekarski</title>
		<link>http://railsforphp.com/2008/02/18/ruby-block-scope/comment-page-1/#comment-231</link>
		<dc:creator>Rafal Piekarski</dc:creator>
		<pubDate>Thu, 17 Apr 2008 21:50:44 +0000</pubDate>
		<guid isPermaLink="false">http://railsforphp.com/2008/02/18/ruby-block-scope/#comment-231</guid>
		<description>But I&#039;ve found some other solution for this:

fruit = %w[apple banana orange]
last_fruit = nil
 
fruit.each do &#124;f&#124; 
  print &quot;#{f}, &quot; 
  last_fruit = f
end
 
print last_fruit

which would be near php method:

fruits = %w[apple banana orange]
fruit = nil
 
fruits.each do &#124;fruit&#124; 
  print &quot;#{fruit}, &quot; 
end
 
print fruit

It&#039;s nicer than method with &quot;last_fruit&quot;. But it&#039;s only a hint.</description>
		<content:encoded><![CDATA[<p>But I&#8217;ve found some other solution for this:</p>
<p>fruit = %w[apple banana orange]<br />
last_fruit = nil</p>
<p>fruit.each do |f|<br />
  print &#8220;#{f}, &#8221;<br />
  last_fruit = f<br />
end</p>
<p>print last_fruit</p>
<p>which would be near php method:</p>
<p>fruits = %w[apple banana orange]<br />
fruit = nil</p>
<p>fruits.each do |fruit|<br />
  print &#8220;#{fruit}, &#8221;<br />
end</p>
<p>print fruit</p>
<p>It&#8217;s nicer than method with &#8220;last_fruit&#8221;. But it&#8217;s only a hint.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://railsforphp.com/2008/02/18/ruby-block-scope/comment-page-1/#comment-93</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Wed, 20 Feb 2008 22:46:49 +0000</pubDate>
		<guid isPermaLink="false">http://railsforphp.com/2008/02/18/ruby-block-scope/#comment-93</guid>
		<description>Thanks for catching the typo.</description>
		<content:encoded><![CDATA[<p>Thanks for catching the typo.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tim</title>
		<link>http://railsforphp.com/2008/02/18/ruby-block-scope/comment-page-1/#comment-92</link>
		<dc:creator>tim</dc:creator>
		<pubDate>Wed, 20 Feb 2008 22:34:03 +0000</pubDate>
		<guid isPermaLink="false">http://railsforphp.com/2008/02/18/ruby-block-scope/#comment-92</guid>
		<description>The sentence &quot;In Ruby, scoping is more dynamic&quot; scares me.

&quot;Dynamic scoping&quot; has a very specific meaning.  PHP appears to use dynamic scoping; Ruby uses lexical scoping, not dynamic scoping.

I&#039;m not sure what you mean by &quot;more dynamic&quot;.  If you mean the dictionary definition (roughly, &quot;energetic&quot;), I&#039;m not sure how that applies.  If you mean the computer science definition, it sounds exactly backwards.</description>
		<content:encoded><![CDATA[<p>The sentence &#8220;In Ruby, scoping is more dynamic&#8221; scares me.</p>
<p>&#8220;Dynamic scoping&#8221; has a very specific meaning.  PHP appears to use dynamic scoping; Ruby uses lexical scoping, not dynamic scoping.</p>
<p>I&#8217;m not sure what you mean by &#8220;more dynamic&#8221;.  If you mean the dictionary definition (roughly, &#8220;energetic&#8221;), I&#8217;m not sure how that applies.  If you mean the computer science definition, it sounds exactly backwards.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
