From: Jim Freeze Date: 2003-04-08T13:28:00+09:00 Subject: Re: Array Sutraction On Tuesday, 8 April 2003 at 13:19:32 +0900, Yukihiro Matsumoto wrote: > Hi, > > In message "Array Sutraction" > on 03/04/08, Jim Freeze writes: > > |So it would seem that Array#- is incomplete and the user > |is required to apply #uniq to the result. > > If you want uniq elements in the result. 1.8.0 Array#- removes > elements in the right operand from the receiver (right operand). > > matz. I'm sorry Matz, I don't understand. I don't have a horse in either the set or bag race. It's just the current implementation is very confusing. If I have a = [1,1,2,2,2] and I subtract [2], then I should get [1,1,2,2] if a is considered a bag. If a is considered a set, then it must first be temporarily converted to a set [1,2] and then the subtraction is performed yielding [1]. However, 1.8.0 returns [1,1]. ruby -ve 'p [1,1,2,2,2]-[2]' ruby 1.8.0 (2003-03-10) [i386-freebsd4.6] [1, 1] -- Jim Freeze ---------- There's no real need to do housework -- after four years it doesn't get any worse.