From: "Yukihiro Matsumoto" <matz / ruby-lang.org>
>
[...]
> 
> So you can persuade me that either
> 
>   * performance is not significant for this operation.
> 
>   * there's better algorithm that makes both performance and
>     duplication possible.

Does this look reasonable, performance-wise ?

class Array
    def -(subtrahend)
        h = {}
        subtrahend.each {|e| h[e] = nil}
        difference = []
        each {|e| difference.push e unless h.has_key? e}
        difference
    end
end

a = [1, 1, 2, 2, 3, 3, 4, 4]
b = [2, 2, 3, 3]
p(a - b)

[1, 1, 4, 4]


Bill

P.S. Thank you matz for this amazing and beautiful language.