From: ts Date: 2002-02-11T23:43:00+09:00 Subject: Re: array diff >>>>> "D" == David Alan Black writes: D> If so, you'd have to differentiate the arrays based on size: ^^^^^^^^^^^^^ D> class Array D> def minus other D> (long,short) = [self,other].max.dup, [self,other].min This is not really what you do pigeon% ruby -e 'a = [1,2]; b = [1,1,2]; p [a,b].max' [1, 2] pigeon% pigeon% ruby -e 'a = [1,2]; b = [1,2,1]; p [a,b].max' [1, 2, 1] pigeon% D> short.each do |el| D> if long.index(el) D> long.delete_at long.index(el) D> end D> end D> long D> end D> end Guy Decoux