From: Robert Klemme Date: 2003-06-28T00:27:50+09:00 Subject: Re: Using & for arrays of objects "Simon Strandgaard" <0bz63fz3m1qt3001@sneakemail.com> schrieb im Newsbeitrag news:pan.2003.06.27.10.33.05.161749@sneakemail.com... > On Fri, 27 Jun 2003 13:21:42 +0200, Robert Klemme wrote: > > > > > "Simon Strandgaard" <0bz63fz3m1qt3001@sneakemail.com> schrieb im > > Newsbeitrag news:pan.2003.06.27.08.07.16.538696@sneakemail.com... > >> On Fri, 27 Jun 2003 10:41:55 +0200, Robert Klemme wrote: > >> > "Simon Strandgaard" <0bz63fz3m1qt3001@sneakemail.com> schrieb im > >> >> > >> >> There is no intersection(&) method. > >> > > >> > There is: > >> > 07:31:22 [temp]: ri 'Array#&' > >> > >> I was refering to the code posted in the root of this thread. > >> You can see that the adjustment I proposed uses Array#&. > > > > Sorry, I don't seem to understand you. The OP used Array#& and it is > > defined. What did you want to say with "There is no intersection(&) > > method"? > > OK.. What I meant with "no intersection method" was: That his class did > not have a Trival#& method defined. I suggested him to use Array#& to > do the intersection for him. > > Sorry, I am terrible at communition :-) No, I'm sorry, but I think in this case you're just plain wrong. :-) I don't think the class needs a method & because array intersection (Array#&) is defined as returning a single array that contains only elements in self and the argument array. Thus elements need only be comparable or similar. No Trivial#& required. As Nobu Nakada pointed out it was the hash method that was missing (at least in during my experimenting). Kind regards robert