From: Martin DeMello Date: 2007-10-08T11:56:05+09:00 Subject: Re: [QUIZ] Itinerary for a Traveling Salesman (#142) On 10/7/07, Dave Pederson wrote: > def ==(gene) > gene.class == self.class && > @city == gene.city && > @lat == gene.lat && > @lon == gene.lon > end The 'pretty' way to do this: [gene.class, gene.city, gene.lat, gene.long] == [self.class, @city, @lat, @long] Introduces a bit of overhead due to the temp array creation, so you probably want to benchmark when doing this in an inner loop. martin