From: Robert Klemme Date: 2008-09-08T01:45:00+09:00 Subject: Re: I have been looking at this little anomoly ?A => 65 2008/9/7 Victor H. Goff III : > I know that the reverse is 65.chr > but I can find no documentation for this (aside from the above line) > > And I wanted to find out more about it, so am trying things like:>> ?A > => 65 >>> hi = "Hello World" > => "Hello World" >>> hi.each {|letter| puts ?letter } > SyntaxError: compile error > (irb):2: syntax error, unexpected '}' > from (irb):2 >>> hi.each {|letter| puts ?"#{letter}" } >>> > ^C >>> hi > => "Hello World" >>> hi.each {|letter| puts letter.? } > (irb):5: warning: invalid character syntax; use ?\s > SyntaxError: compile error > (irb):5: syntax error, unexpected '?' > hi.each {|letter| puts letter.? } > ^ > from (irb):5 >>> hi.each {|letter| puts letter.?\s } > SyntaxError: compile error > (irb):6: syntax error, unexpected tINTEGER > hi.each {|letter| puts letter.?\s } > ^ > from (irb):6 >>> hi.each {|letter| puts letter.?\s65 } > SyntaxError: compile error > (irb):7: syntax error, unexpected tINTEGER > hi.each {|letter| puts letter.?\s65 } > ^ > from (irb):7 > Try hi.each {|l| p [l, l.class]} to see why it does not work. Kind regards robert -- use.inject do |as, often| as.you_can - without end