From: Gavin Sinclair Date: 2003-04-12T20:23:56+09:00 Subject: Re: [BUG] "illegal radix 1" On Friday, April 11, 2003, 5:26:48 PM, Daniel wrote: >> |>> "2".to_i *1.1 >> |ArgumentError: illegal radix 1 >> | from (irb):2:in `to_i' >> | from (irb):2 >> |>> "2".to_i * 1.1 >> |=> 2.2 >> >> "2".to_i *1.1 is parsed as "2".to_i(*1.1). Try -w if you have doubt. > Yes, I figured it was something like that. But don't you think that Ruby > should be able to figure that out? > I don't know. I don't think I've seen this problem in other high-level > languages. I guess that this is part of how I would expect a high-level > language to "stay out of my way" and let me focus on the problem I am > actually trying to solve. Your point about high-level languages is good, but this is the cost of Ruby's power. Most high-level languages are pretty simple and gutless, making it easy to normalise the input. Fortunately, as Matz said, the -w flag picks up things like this easily. I use it as a habit. The only time I really have trouble finding where a parse (or similar) error occurs is when I've left out a closing bracket or something. Gavin