From: Martin Bonner Date: 2003-04-09T00:57:45+09:00 Subject: Re: Array Sutraction ----- Original Message ----- From: "Jim Freeze" | On Tuesday, 8 April 2003 at 22:59:50 +0900, Michael Campbell wrote: | > > | > > I don't find this confusing. In fact I find the implicit | > > application of | > > uniq (older version) more confusing because it is somewhat | > > surprising - at | > > least to me. In that case substraction indeed combines two | > > operations. | > > | > > I'd view the substraction "a-b" as "remove all elements in b from | > > a", | > > which would reasonable lead to all 2's removed from [1,1,2,2,2] | > > yielding | > > [1,1]. | > | > | > So [1, 1, 2, 2] - [2] should yield the same as [1, 1, 2, 2] - [2, 2]? | > 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. :) Hmm.. there might still be some confusion there. I might expect that to remove all elements from the array. Perhaps it should be called #remove_all_elements_equivalent_to ** :) Marty ** This was funny when I thought of it, but Austin, Texas has more than its share of allergens in the air right now, so my head feels rather like a recently kicked (US)football. | -- | Jim Freeze | ---------- | F: When into a room I plunge, I | Sometimes find some VIOLET FUNGI. | Then I linger, darkly brooding | On the poison they're exuding. | -- The Roguelet's ABC