From: Robert Dober Date: 2007-03-17T08:10:36+09:00 Subject: Re: Issues using array.delete within a loop of the same array On 3/16/07, james.d.masters@gmail.com wrote: > On Mar 16, 3:08 pm, "Phrogz" wrote: > > Kindly suggest that you RTFM by typing "ri Array#delete_if" into your > > console. :) > > I did RTFM before posting. The question in my original posting was > related to the behavior of deleting items from a list during iteration > so that's why I posted Array#delete_if within the context of > Array#each. To use Array#delete_if outside of the iteration does the > job yet the original question remained. I think that the answer is > that deleting from the same array during an iteration is a no-no using > Array#each... I'm OK with that. I'll use Array#delete_if or > Array.reject! > > Thanks... > The code I posted was version 1.8.5 p12, and of course I should have added that the behavior is not defined. YARV does exactly the same right now though. Good to point it out clearly. Cheers Robert > > > -- You see things; and you say Why? But I dream things that never were; and I say Why not? -- George Bernard Shaw