From: James Britt Date: 2005-12-24T00:12:18+09:00 Subject: Re: Displaying object variables, not obj ID Tobias Jonch wrote: > On 12/23/05, Jim Weirich wrote: > >> >>Perhaps you are not aware that defining a to_s method in the Chromosome >>class will only affect how Chromosomes are displayed, nothing else. > > > > Astonishing as it may seem, I do know ;-) > > I'm not calling to_s from the chromosome class, however, and that does > matter, right? You are invoking the Chromosome version of to_s method on instances of Chromosome. When you call to_s on an instance of a class, and you get back that ClassName:0xID thing, it means that that object does not have its own to_s method defined, so it defaults to calling Object's to_s (which of course as no idea how to stingify this particular class). So you need to give Chromosome instances their own to_s. James -- http://www.ruby-doc.org - Ruby Help & Documentation http://www.artima.com/rubycs/ - Ruby Code & Style: Writers wanted http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys http://www.30secondrule.com - Building Better Tools