From: Eric Mahurin Date: 2005-11-19T23:40:16+09:00 Subject: Re: Symbol#inspect bug? On 11/19/05, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: Symbol#inspect bug?" > on Sat, 19 Nov 2005 08:22:20 +0900, "Dominik Bathon" writes: > > |But it doesn't for symbols starting with a digit: > | > |irb(main):001:0> p :"9" > |:9 > > Which version are you using? > > % ruby -ve 'p :"9"' > ruby 1.8.4 (2005-10-29) [i486-linux] > :"9" > > So it's reserved to be fixed. > > matz. Thanks matz. I just downloaded 1.8.4 preview1 and tried this out. It looks like only one case isn't fixed yet (:"["): [eric@localhost ruby-1.8.4]$ ./ruby -v ruby 1.8.4 (2005-10-29) [i686-linux] [eric@localhost ruby-1.8.4]$ ./ruby 1.upto(255) do |c0| 0.upto(255) do |c1| str = c0.chr str.concat(c1.chr) if c1.nonzero? inspect0 = ":#{str.inspect}" eval0 = eval(inspect0) inspect1 = eval0.inspect begin eval1 = eval(inspect1) eval1==eval0 or puts "#{eval1}!=#{eval0}" rescue SyntaxError puts "Couldn't eval(#{inspect1} = eval(#{inspect0}).inspect)" end end end Couldn't eval(:[ = eval(:"[").inspect) I didn't realize that symbols can't handle empty strings or the null character until I tried this.