From: Dominik Bathon Date: 2005-11-19T09:09:51+09:00 Subject: Re: Symbol#inspect bug? On Sat, 19 Nov 2005 00:57:28 +0100, Eric Hodel wrote: > On Nov 18, 2005, at 3:22 PM, Dominik Bathon wrote: > >> Symbol#inspect should return a valid symbol literal, right? > > Not according to the RDoc: > > $ ri Object#inspect > --------------------------------------------------------- Object#inspect > obj.inspect => string > ------------------------------------------------------------------------ > Returns a string containing a human-readable representation of > _obj_. If not overridden, uses the +to_s+ method to generate the > string. > > [ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]" > Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT > 2003" Yes, but: $ ri Symbol#inspect --------------------------------------------------------- Symbol#inspect sym.inspect => string ------------------------------------------------------------------------ Returns the representation of sym as a symbol literal. :fred.inspect #=> ":fred"