From: Todd Benson Date: 2007-11-08T13:11:33+09:00 Subject: Re: how to delete array On Nov 7, 2007 10:05 PM, Todd Benson wrote: > On Nov 7, 2007 9:47 PM, ara.t.howard wrote: > > cfp:~ > cat a.rb > > array = 1, 2, 3, 4, 7, 4 > > > > index = 1, 3 > > i = -1 > > array.delete_if{ index.delete(i+=1) } > > This is excellent! Only, what if your underlying implementation does > not traverse an array in order with #delete_if ? As it turns out, it > does, but would it have to? I see #delete_if as a conditional that > has nothing to do with the Array's ordering, so I was a little > surprised at this assumption. > > Todd > Nevermind that. I can see how you might want to consider position in a condition (maybe state machine stuff or whatever). #delete_if is after all an Array method, which is the only set of objects that require a linear order. Sorry for noise now. Todd