<?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"
	>
<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>
	<pubDate>Sat, 10 May 2008 22:13:02 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Rafal Piekarski</title>
		<link>http://railsforphp.com/2008/02/18/ruby-block-scope/#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've found some other solution for this:

fruit = %w[apple banana orange]
last_fruit = nil
 
fruit.each do &#124;f&#124; 
  print "#{f}, " 
  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 "#{fruit}, " 
end
 
print fruit

It's nicer than method with "last_fruit". But it'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-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-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 "In Ruby, scoping is more dynamic" scares me.

"Dynamic scoping" has a very specific meaning.  PHP appears to use dynamic scoping; Ruby uses lexical scoping, not dynamic scoping.

I'm not sure what you mean by "more dynamic".  If you mean the dictionary definition (roughly, "energetic"), I'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>

<!-- Dynamic Page Served (once) in 1.159 seconds -->
