From: Joel VanderWerf Date: 2006-11-02T05:33:42+09:00 Subject: Re: Question about the Set class, XOR, and arrays Daniel Berger wrote: > Hi all, > > Ruby 1.8.5 > > irb(main):002:0> Set[1,2,3] ^ Set[3,4,5,5] > => # > > Ok, looks good. > > irb(main):003:0> Set[1,2,3] ^ [3,4,5,5] > => # > > What?! I'm confused. Do I need a refresher in Set theory or something? I think I can guess why it is happening: irb(main):009:0> (0..10).each {|n| p Set[1,2,3] ^ ([3,4]+[5]*n)} # # # # # # # # # # # => 0..10 Looks like the array argument is used to flip-flop the elements of the set. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407