<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Odd Rubyism</title>
	<atom:link href="http://drewblas.com/2009/01/02/odd-rubyism/feed/" rel="self" type="application/rss+xml" />
	<link>http://drewblas.com/2009/01/02/odd-rubyism/</link>
	<description>The life and code of a passionate developer</description>
	<lastBuildDate>Sun, 05 Feb 2012 07:46:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: James Robey</title>
		<link>http://drewblas.com/2009/01/02/odd-rubyism/#comment-149</link>
		<dc:creator><![CDATA[James Robey]]></dc:creator>
		<pubDate>Thu, 04 Feb 2010 14:57:55 +0000</pubDate>
		<guid isPermaLink="false">http://drewblas.com/?p=64#comment-149</guid>
		<description><![CDATA[Well, an item is being deleted from the array while the array itself is being used for the loop.

Basically, it&#039;s behaving normally, the array is shrinking, while the internal count is staying the same.

[0,1,2], count is 0  item = 0

delete 0, then increment count at end of loop

[1,2], count 1   item = 2

Hashes are unordered, so perhaps it doesn&#039;t use an internal counter at all, but a pointer instead.  Maybe that&#039;s why the behavior is different.]]></description>
		<content:encoded><![CDATA[<p>Well, an item is being deleted from the array while the array itself is being used for the loop.</p>
<p>Basically, it&#8217;s behaving normally, the array is shrinking, while the internal count is staying the same.</p>
<p>[0,1,2], count is 0  item = 0</p>
<p>delete 0, then increment count at end of loop</p>
<p>[1,2], count 1   item = 2</p>
<p>Hashes are unordered, so perhaps it doesn&#8217;t use an internal counter at all, but a pointer instead.  Maybe that&#8217;s why the behavior is different.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Stehle</title>
		<link>http://drewblas.com/2009/01/02/odd-rubyism/#comment-132</link>
		<dc:creator><![CDATA[John Stehle]]></dc:creator>
		<pubDate>Wed, 11 Mar 2009 20:11:43 +0000</pubDate>
		<guid isPermaLink="false">http://drewblas.com/?p=64#comment-132</guid>
		<description><![CDATA[Yes! that is not what one would expect.  I ran across this behavior and did not know if it was as designed or not.  What I do is nil the elements I want to delete then do a compact! on the array.]]></description>
		<content:encoded><![CDATA[<p>Yes! that is not what one would expect.  I ran across this behavior and did not know if it was as designed or not.  What I do is nil the elements I want to delete then do a compact! on the array.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Kayser</title>
		<link>http://drewblas.com/2009/01/02/odd-rubyism/#comment-118</link>
		<dc:creator><![CDATA[Bill Kayser]]></dc:creator>
		<pubDate>Sun, 04 Jan 2009 18:53:51 +0000</pubDate>
		<guid isPermaLink="false">http://drewblas.com/?p=64#comment-118</guid>
		<description><![CDATA[Java iterator behavior is well-defined and predictable.  There are different iterator types that support different features.  Generally if you delete or add an underlying element while iterating the iterator will throw a concurrent modification exception.  

Other iterator types support things like going forward and backward, inserting at the current index, and deleting the current item--without throwing the exception.  That allows you to avoid the copy on read pattern to avoid the exception.]]></description>
		<content:encoded><![CDATA[<p>Java iterator behavior is well-defined and predictable.  There are different iterator types that support different features.  Generally if you delete or add an underlying element while iterating the iterator will throw a concurrent modification exception.  </p>
<p>Other iterator types support things like going forward and backward, inserting at the current index, and deleting the current item&#8211;without throwing the exception.  That allows you to avoid the copy on read pattern to avoid the exception.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: José Valim</title>
		<link>http://drewblas.com/2009/01/02/odd-rubyism/#comment-115</link>
		<dc:creator><![CDATA[José Valim]]></dc:creator>
		<pubDate>Fri, 02 Jan 2009 18:30:11 +0000</pubDate>
		<guid isPermaLink="false">http://drewblas.com/?p=64#comment-115</guid>
		<description><![CDATA[Very odd inded!
Have you checked Ruby 1.9 if we have the same behavior? =)]]></description>
		<content:encoded><![CDATA[<p>Very odd inded!<br />
Have you checked Ruby 1.9 if we have the same behavior? =)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

