From: Chad Perrin Date: 2007-10-16T05:52:03+09:00 Subject: Re: nil.to_i returning zero On Tue, Oct 16, 2007 at 05:39:39AM +0900, Gerardo Santana G?mez Garrido wrote: > > Let me just precise that I'm ok with nil.to_s. > > It's nil.to_i I'm uncomfortable with Why the difference? Doesn't "" (the output of nil.to_s) evaluate to true in a boolean context, too? > irb irb(main):001:0> foo = nil.to_s => "" irb(main):002:0> puts "true" if foo true => nil That seems to be the exact same problem cited for nil.to_i, as far as I can tell. -- CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] Amazon.com interview candidate: "When C++ is your hammer, everything starts to look like your thumb."