----- Original Message ----- From: "ts" <decoux / moulon.inra.fr> To: "ruby-talk ML" <ruby-talk / ruby-lang.org> Cc: <ruby-talk / ruby-lang.org> Sent: Monday, June 24, 2002 6:40 AM Subject: Re: No exceptions from String#to_i > >>>>> "H" == Hal E Fulton <hal9000 / hypermetrics.com> 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