From: Ryan Davis Date: 2006-10-11T18:10:46+09:00 Subject: Re: [ ruby-Bugs-6090 ] Loop over array.delete breaks at first hit On Oct 10, 2006, at 10:28 PM, ville.mattila@stonesoft.com wrote: >> Modifying iterating array inside the loop may fail. Do it with your >> own risk. Checking it may hinder the performance. As you've found >> out by yourself, delete_if is your friend for the purpose. It's >> shorter, faster, and more convenient. > > This rule seems to belong "the principle of the most surprise > category". > Is this documented somewhere? In every good data structures book out there, the smalltalk style guide, c2.com... all over Destructive iteration of collections is simply a Bad Thing�. Just don't do it. P.S. rename is_foo to foo?