On Feb 4, 2006, at 13:10, ara.t.howard / noaa.gov wrote:

> On Sun, 5 Feb 2006, Dave Howell wrote:
>>
>> Can somebody explain to me how I'm supposed to delete a *single* 
>> element from an array based on equivalence with an object? and get 
>> back said array with said element deleted?
>>
>> In other words....
>>
>> ar = [1, 2, 3, 8, 15, 15, 8]
>>
>> ar.delete_one_element!(15)
>> => [1, 2, 3, 8, 15, 8]
>>
>> ar.delete_one_element!(14)
>> => [1, 2, 3, 8, 15, 15, 8]
>>
>> ar.delete_one_element!(nil)
>> => [1, 2, 3, 8, 15, 15, 8]
>>
>> I did find so many different ways of not doing this....
>>

>   class Array
>     def remove(*args) replace(self - args) end
>   end
>
>   a = %w( a b b )
>   p a.delete_if{|x| x == "b"}
>   p(a.delete("b") && a)
>   p a.select{|x| x != "b"}
>   p a - ["b"]
>   p a.remove("b", "c")
>
> all return
>   ["a"]

This is just a list of many other ways to not do what I want, yes? 
<scratch head>