From: David Naseby Date: 2004-05-19T12:53:56+09:00 Subject: Re: Zero is true ... whoda thunk? >-----Original Message----- >From: Hal Fulton [mailto:hal9000@hypermetrics.com] >>> if got_milk? ... end >>> >>>where >>> >>> def got_milk? >>> @milk_volume.zero? >> >> >> Bugger. I mean !@milk_volume.zero? of course. So this whole >problem could >> be avoided by making 0==false, thus proving your point. THIS >is why I don't >> post normally.... > >Haha... well, the got-milk logic would mean that negative numbers >would also be false, right? "I've got -5 gallons of milk. Give me >5 gallons, and I still won't have any!" > >Now you've got me thinking about the Mad Hatter's tea party... You are just making the foolish mistake of assuming that just because my @milk_volume attribute responds to #zero? its a number, which, of course, in this mythical example, it isn't. It's a volume type (quart, in this case, as I'm speaking to old-fashioned types...), quite well defined, so when Rover checks if his milk volume, he finds out the answer in only ONE unit of measurement.... David.