From: Jim Freeze Date: 2001-07-13T22:00:53+09:00 Subject: [ruby-talk:17790] Re: What is Array#- ? On Fri, 13 Jul 2001, Stephan [iso-8859-1] K�mper wrote: > What I think is, that we have 'Array's on one side: They're not sets, > because 'Array's _may_ contain elements more than once. (As far as I see > there are way more efficient implementation possibilities for set than > Array, but that's another question.) > OTOH, we (now and then) like 'Array's to behave like an Array. > Thus there is Array#-. It returns an object that fits the requirements of a > set: There may or may not be any objects in it, and the objects that > actually are there are unique. > Thanks for the clear description. If we analyze this from a 'unit' perspective, we get: (set) = (bag) - (bag) # wrong (set) = (bag) - (set) # wrong When I first saw this it took me by suprise. I saw Matz' posting that this was done for performance reasons. But, IMHO, I think that if this Array conversion is wanted, that it should be implemented under a different name. And keep Array#- as would be expected. $0.02 ========================================================= Jim Freeze jim@freeze.org --------------------------------------------------------- No comment at this time. http://www.freeze.org =========================================================