From: Yukihiro Matsumoto Date: 2006-10-12T08:23:57+09:00 Subject: Re: [ ruby-Bugs-6090 ] Loop over array.delete breaks at first hit Hi, In message "Re: [ ruby-Bugs-6090 ] Loop over array.delete breaks at first hit" on Thu, 12 Oct 2006 04:42:08 +0900, mathew writes: |As far as deleting elements from a collection while iterating over it, I |would expect the behavior to be undefined. Depending on the implementation |of the collection you might end up skipping elements, accessing unallocated |memory, causing an out of bounds error, or (as in this case) terminating too |soon. The surprising thing would be if it magically divined the programmer's |intent and worked. You are right, except that array iteration does check memory boundary to avoid accessing unallocated memory. Yesterday, I have tried to add the code to detect this problem automagically but the check was too strict to bother other working programs. matz.