On 10/7/07, Dave Pederson <dave.pederson.ruby / gmail.com> 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