From: Jim Freeze Date: 2001-07-13T05:52:23+09:00 Subject: [ruby-talk:17753] Re: What is Array#- ? On Fri, 13 Jul 2001, Dave Thomas wrote: > Jim Freeze writes: > > > 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? > > Forgive the doubled minus sign - wee LaTeX -> HTML conversion > problem. However: > > http://www.rubycentral.com/book/ref_c_array.html#_mi_mi > > Yes, but why remove duplicates? Doesn't seem to make sense. I was hoping for something close to set theory. ========================================================= Jim Freeze jim@freeze.org --------------------------------------------------------- No comment at this time. http://www.freeze.org =========================================================