On Feb 4, 2006, at 13:10, Wilson Bilkovich wrote:

> If I'm understanding you properly, this is one way:
>
> class Array
>   def delete_one_element!(value)
>     return self unless i = self.index(value)
>     self[i] = nil
>     self.compact!
>   end
> end
>

You are, but it isn't. I might well have "nil" as a legitimate item in 
the array, and .compact would erase all of them. I definitely want a 
solution that can _never_ reduce the size of my array by more than one 
element.