From: Jim Freeze Date: 2001-07-13T04:56:37+09:00 Subject: [ruby-talk:17747] What is Array#- ? While following the Array thread, I noticed the minus operator. So I tried: irb(main):001:0> a=%w{1 2 3} ["1", "2", "3"] irb(main):002:0> a-["3"] ["1", "2"] All well and good. But then I tried: irb(main):003:0> a=%w{1 1 2 2 3 3 3} ["1", "1", "2", "2", "3", "3", "3"] irb(main):004:0> a-["3"] ["1", "2"] This looks like this is really the minus operation mixed with the uniq operation. a1 - a2 => a1.uniq - a2.uniq or maybe a1 - a2 => (a1-a2).uniq Someone care to explain this behavior? Thanks ========================================================= Jim Freeze jim@freeze.org --------------------------------------------------------- No comment at this time. http://www.freeze.org =========================================================