From: Aristarkh A Zagorodnikov Date: 2001-08-24T21:07:56+09:00 Subject: [ruby-talk:20277] Re: In Ruby 0 is true but nil is false.. or how to shoot yourself?.. > -----Original Message----- > From: gc@mandrakesoft.com [mailto:gc@mandrakesoft.com] > Sent: Friday, August 24, 2001 4:05 PM > To: ruby-talk ML > Subject: [ruby-talk:20276] Re: In Ruby 0 is true but nil is > false.. or how to shoot yourself?.. > > > jweirich@one.net writes: > > > [...] > > > Everytime someone suggests making more things "false", I think of this > > conversation. > > I didn't suggest making more things false. > > I said I was shot in the foot because of the following (apprently > misunderstood) inconsistency: you may test something which would yield > "nil" for its truth value, because "nil" is false, but you may not with > "0" because every numbers including "0" is true. > > The inconsistency is because Ruby will silently assume than 0 is false. > > I would like that either "0" is false, or that testing for truth value for > a number would throw an exception. I'm against any changes ... it is a very consistent scheme, maybe not so neat but forcing a clearer checks and overall design. Aristarkh A Zagorodnikov, Lead Programmer, W3D Group http://www.w3d.ru /// xm@w3d.ru /// ICQ UIN 36987938