On Tuesday 30 November 2004 12:07 pm, Charles Mills wrote:
| Array#to_s is essentially Array#join with no args... irb uses #inspect
| to display the result of each statement.  It is a bit annoying when you
| have highly nested objects and/or objects with lots of instance
| variables that give you about a page and a half of output when inspect
| is called.  I guess if you know your class is going to be like that is
| may be useful to define inspect something like the following:
| ###
| def inspect()
|    "#<#{self.class}: #{@very_important_ivar}>"
| end
| ###
| Opinions may differ though...

Indeed. I like the idea that #inspect produce a string that will produce an 
equivalent object when passed through #eval. This already works for literal 
forms like Array.

T.