From: gabriele renzi Date: 2004-11-30T21:52:47+09:00 Subject: Re: to_s, inspect, etc. Giulio Piancastelli ha scritto: > Florian Gross wrote: > > >>itsme213 wrote: >> >>>Are to_s, inspect, etc. defined more-or-less consistently for the > > library > >>>classes? Are they used consistently by the various tools like irb, > > debug, > >>>test/unit, breakpoint, etc? >> >>.inspect is usually used for debug purposes and .to_s for end-user >>purposes. > > > So, why does [1,2,3].to_s give '123' and [1,2,3].inspect give '[1, 2, > 3]' as answers? Not a really end-user answer, the one given by > Array#to_s, isn't it? The inspect method here is much more end-user > oriented: why is that? > > Regards, > Giulio Piancastelli. >