From: Joachim Glauche Date: 2007-10-15T19:39:38+09:00 Subject: Re: nil.to_i returning zero Robert Dober wrote: > My pragmatic question is therefore: > nil.to_i usecases anyone? I remember using it somewhere. I think I used it for catching user input integer values like unless val.to_i == 0; ... ; end The nil.to_something behaviour seems logical to me: nil.to_i = Returns the integer which represents "nothing" = 0 nil.to_s = Returns the string which represents "nothing" = "" ... -- Posted via http://www.ruby-forum.com/.