From: Ryan Davis Date: 2007-11-23T04:20:32+09:00 Subject: Re: Checking whether a string is a number in disguise? On Nov 22, 2007, at 10:05 , Peter Bunyan wrote: > Is that the only way to do it? There's no built-in method for > telling if > a string is a number? :( Strings are never numbers in ruby. Ever. That is the beauty of working in a clean typesafe language. What you're doing, possibly without realizing it, is writing a parser for RPN but it sounds like you've not addressed this project like a parser. I suggest you go look at the screencast for treetop (a parser generator). In this screencast they build up an infix parser, which is much more than you need for RPN, but the tool is clean, powerful, and worth learning. http://www.pivotalblabs.com/files/treetop-arithmetic-example.mov