From: Christoffer Sawicki Date: 2006-08-29T04:36:24+09:00 Subject: Re: Integer(nil) versus Float(nil) versus String(nil) On 8/24/06, David Vallner wrote: > Probably. > > > But my Java-addled brain makes me make damn sure nulls / nils don't come > anywhere near I expect actual data, like into collections or numbers. If > you don't rely on automagical conversion to work, it can't bite you if > it doesn't. Just code explicitly. > That's definitely a valid point, but slightly irrelevant. > The to_foo and #Foo() type conversion methods being different always > confuses the heck of me, which is why I get paranoid around them. Does > anyone have a link to some rationale for and explanation of the difference? Integer/Float are usually considered to be the *strict* equivalents of to_i/to_f. Try to feed them non-number strings and you'll see. I don't know anything more about them though. :) Anyway, I was a bit puzzled over these two things on Integer/Float: 1) Them accepting nil at all 2) The (IMHO) inconsistency I can accept both things as they are, since nothing says they should act the way I except them to, but I thought it could be good to bring it up. Cheers, -- Christoffer Sawicki http://vemod.net/