From: james.d.masters@... Date: 2007-03-17T07:10:05+09:00 Subject: Re: Issues using array.delete within a loop of the same array On Mar 16, 2:02 pm, MenTaLguY wrote: > a = [] creates a new, empty array; it does not empty the existing array. Yup, good point. > It's disallowed by design -- removing elements in the midst of iteration would be a bit like trying to remove carpet tiles while you are standing on them. OK, I'll take that... I had a feeling that would be the final answer. Although I can't see why it wouldn't be feasible in a language - especially as I'm removing the current item of iteration (i.e. not one further down the list) and when there are no duplicates of the same object in the array. > Have you considered using Array#reject! to iterate over the array? You can use the result of the block for each iteration (true or false) to control whether each element is dropped or retained once the iteration completes. I vaguely remember reading about Array#reject! but haven't used it much - I'll have to give that a shot. Thanks...