From: Nikodemus Siivola Date: 2002-06-24T21:12:00+09:00 Subject: Re: No exceptions from String#to_i On Mon, 24 Jun 2002, ts wrote: > use #Integer if you want an error More whys and wherefore's... I find this mildly strange: Integer('') #-> exception Integer(nil) == 0 Integer(false) #-> exception Integer(:foo) == 14145 Integer('foo') #-> exception Is this 'jus the way it is', or is there a reason? I suppose symbols get hashed, but then why not apply the same logic to strings as well? Also, since nil and false are the only non-true values, I would expect them to be treated the same in such a case. Further strangeness: Why ? Array(foo) == foo.to_a String(foo) == foo.to_s Integer(foo) != foo.to_i Float(foo) != foo.to_f -- Nikodemus