From: "David A. Black" Date: 2005-02-22T22:24:25+09:00 Subject: Re: Proposal for nil, 0, and "" in an if statement Hi -- On Tue, 22 Feb 2005, Dan Fitzpatrick wrote: > The following was derived from a portion of the destrutive! operations > thread. > > Here is a proposal for evaluating "", 0, and nil in an if statement: > > Add empty? to NilClass and Fixnum > > class NilClass > def empty? > true > end > end > > class Fixnum > def empty? > self == 0 ? true : false > end > end Or: class Fixnum alias :empty? :zero? end David -- David A. Black dblack@wobblini.net