From: David Alan Black Date: 2000-12-03T20:48:43+09:00 Subject: [ruby-talk:6762] Re: Array Intersect (&) question On Sun, 3 Dec 2000, Clemens Hintze wrote: > matz> Using a hash makes it pretty fast, but it does not preserve > matz> the original order. If no one requests order preservation, > matz> I will use hashes in &, |, and uniq. What's your opinion? > > for me this would be ok! If I want to rely on order, I would simply > order it afterwards. The operators &, | are SET operations. In a set > neither the order nor the cound is important! > > So I have to confess that every time I used them, I had ordered my > results anyway, as I did not assume any order. So that there is an > order here violates my POLS ;-) > > Speed is an issue here, IMHO. I agree. Even if & and | ignore order, there are still ways to order the data -- no functionality is lost. If they sacrifice speed, that's a lot harder to make up for. David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav