----- Original Message ----- From: "Austin Ziegler" <austin / halostatue.ca> To: "ruby-talk ML" <ruby-talk / ruby-lang.org> Sent: Tuesday, April 08, 2003 10:52 AM Subject: Re: Array Sutraction > >> That seems odd to me. > > Yes. It's not really subtraction as implied by the '-' minus > > operator. Maybe it should be renamed to #remove_all_from. :) > > I think it's more confusing when dealing with numbers than with > Objects. > > i = Object.new # => #<Object:0x277c230> > j = Object.new # => #<Object:0x276fdf8> > k = Object.new # => #<Object:0x2768898> > a = [i, j, k, i, i] > > a - [i] # => [j, k] > [i].each { |e| a.delete(e) } > # => [j, k] > > You're removing a specific Object from an array. At least, IMO. Hmmmmmmm. x = ["one", "one", "two", "two", "two"] y = ["two"] What do you want x-y to be here? Hal