From: Paul Battley Date: 2006-06-30T00:24:36+09:00 Subject: Re: Changes to x within x.each() On 29/06/06, Phillip Hutchings wrote: > From experience Ruby keeps an array index to do each, so if something > inserted after obj it'll work, but something before will cause each to > get obj twice. Yep. You can see this in the 'why do only half the elements from my array get deleted?' problem: array = %w[a b c d e f g h i j k] array.each do |e| array.delete(e) end array # => ["b", "d", "f", "h", "j"] Paul.