From: "Hal E. Fulton" Date: 2002-06-24T20:52:49+09:00 Subject: Re: No exceptions from String#to_i ----- Original Message ----- From: "ts" To: "ruby-talk ML" Cc: Sent: Monday, June 24, 2002 6:40 AM Subject: Re: No exceptions from String#to_i > >>>>> "H" == Hal E Fulton writes: > > H> I know it's been discussed before, but I > H> can't find it now. > > use #Integer if you want an error > > pigeon% ruby -e 'Integer("")' > -e:1:in `Integer': invalid value for Integer: "" (ArgumentError) > from -e:1 > pigeon% Ah, thank you, I remember that now. Which raises the question: Why is this "non-OO"? Why not str.integer (for instance) instead of Integer(str)? Is it just to make it more universally available (i.e., to different data types, Integer(non_str_obj))? And why is Integer capitalized? I know of only four methods in the entire Ruby core that start with capital letters. I sound like a five year old, do I not? Always asking why... :) Thanks, Hal Fulton