<?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: Iteration Shouldn&#8217;t Spin Your Wheels!</title>
	<atom:link href="http://www.engineyard.com/blog/2010/iteration-shouldnt-spin-your-wheels/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.engineyard.com/blog/2010/iteration-shouldnt-spin-your-wheels/</link>
	<description></description>
	<lastBuildDate>Wed, 08 Feb 2012 12:12:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Evan Phoenix</title>
		<link>http://www.engineyard.com/blog/2010/iteration-shouldnt-spin-your-wheels/comment-page-1/#comment-40181</link>
		<dc:creator>Evan Phoenix</dc:creator>
		<pubDate>Thu, 28 Jan 2010 17:35:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=3205#comment-40181</guid>
		<description>Oh geez! So sorry about the Array#map confusion. 1.8.7 is a bit inconsistent about when Enumerators are returned. You can instead do: 
 
ary.dup.map!.with_index { &#124;e,i&#124; ... } 
 
Or as Ryan pointed out 
 
ary.to_enum(:map).with_index { &#124;e,i&#124;  ... } 
 
Sorry for the confusion. </description>
		<content:encoded><![CDATA[<p>Oh geez! So sorry about the Array#map confusion. 1.8.7 is a bit inconsistent about when Enumerators are returned. You can instead do: </p>
<p>ary.dup.map!.with_index { |e,i| &#8230; } </p>
<p>Or as Ryan pointed out </p>
<p>ary.to_enum(:map).with_index { |e,i|  &#8230; } </p>
<p>Sorry for the confusion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://www.engineyard.com/blog/2010/iteration-shouldnt-spin-your-wheels/comment-page-1/#comment-40175</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Thu, 28 Jan 2010 15:57:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=3205#comment-40175</guid>
		<description>Yeah, thanks for the misinformation. </description>
		<content:encoded><![CDATA[<p>Yeah, thanks for the misinformation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: miky</title>
		<link>http://www.engineyard.com/blog/2010/iteration-shouldnt-spin-your-wheels/comment-page-1/#comment-40161</link>
		<dc:creator>miky</dc:creator>
		<pubDate>Thu, 28 Jan 2010 13:18:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=3205#comment-40161</guid>
		<description>Thank you for the article.  
AFAIK what you&#039;ve said about enumerators apply only to ruby &gt;= 1.9 
 
$ irb 
irb(main):001:0&gt; RUBY_VERSION 
=&gt; &quot;1.9.2&quot; 
irb(main):002:0&gt;  ary = [1,3,5] 
=&gt; [1, 3, 5] 
irb(main):003:0&gt;   ary.map 
=&gt; #&lt;Enumerator: [1, 3, 5]:map&gt; 
irb(main):004:0&gt; exit 
$ rvm use ruby-1.8.7          
 
Now using ruby 1.8.7 p248 
 
$ irb 
irb(main):001:0&gt; ary = [1,3,5] 
=&gt; [1, 3, 5] 
irb(main):002:0&gt; ary.map 
=&gt; [1, 3, 5] 
irb(main):003:0&gt; ary.map.class 
=&gt; Array </description>
		<content:encoded><![CDATA[<p>Thank you for the article. </p>
<p>AFAIK what you&#039;ve said about enumerators apply only to ruby &gt;= 1.9</p>
<p>$ irb</p>
<p>irb(main):001:0&gt; RUBY_VERSION</p>
<p>=&gt; &quot;1.9.2&quot;</p>
<p>irb(main):002:0&gt;  ary = [1,3,5]</p>
<p>=&gt; [1, 3, 5]</p>
<p>irb(main):003:0&gt;   ary.map</p>
<p>=&gt; #&lt;Enumerator: [1, 3, 5]:map&gt;</p>
<p>irb(main):004:0&gt; exit</p>
<p>$ rvm use ruby-1.8.7         </p>
<p>Now using ruby 1.8.7 p248</p>
<p>$ irb</p>
<p>irb(main):001:0&gt; ary = [1,3,5]</p>
<p>=&gt; [1, 3, 5]</p>
<p>irb(main):002:0&gt; ary.map</p>
<p>=&gt; [1, 3, 5]</p>
<p>irb(main):003:0&gt; ary.map.class</p>
<p>=&gt; Array</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gabe da Silveira</title>
		<link>http://www.engineyard.com/blog/2010/iteration-shouldnt-spin-your-wheels/comment-page-1/#comment-40134</link>
		<dc:creator>Gabe da Silveira</dc:creator>
		<pubDate>Thu, 28 Jan 2010 07:46:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=3205#comment-40134</guid>
		<description>I was feeling pretty smug about my Ruby knowledge until the last one about Enumerators which was brand new to me.  Awesome! </description>
		<content:encoded><![CDATA[<p>I was feeling pretty smug about my Ruby knowledge until the last one about Enumerators which was brand new to me.  Awesome!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan Briones</title>
		<link>http://www.engineyard.com/blog/2010/iteration-shouldnt-spin-your-wheels/comment-page-1/#comment-40113</link>
		<dc:creator>Ryan Briones</dc:creator>
		<pubDate>Thu, 28 Jan 2010 03:21:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.engineyard.com/blog/?p=3205#comment-40113</guid>
		<description>I sent this to a coworker because he thought he needed to write his own &quot;map with index&quot; a couple of weeks ago. On 1.8.7, at least the 1.8.7 provided by default with Snow Leopard, map always seems to return an array; not an Enumerator. *sad face* 
 
However I did get the following to work: 
 
[1,2,3].to_enum(:map).with_index { &#124;f, i&#124; [f, i] } 
 
Thanks for the article! </description>
		<content:encoded><![CDATA[<p>I sent this to a coworker because he thought he needed to write his own &quot;map with index&quot; a couple of weeks ago. On 1.8.7, at least the 1.8.7 provided by default with Snow Leopard, map always seems to return an array; not an Enumerator. *sad face* </p>
<p>However I did get the following to work: </p>
<p>[1,2,3].to_enum(:map).with_index { |f, i| [f, i] } </p>
<p>Thanks for the article!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

