From: "David A. Black" Date: 2008-08-24T11:26:52+09:00 Subject: Re: Why 'if 0' succeeds in Ruby Hi Ed -- On Sun, 24 Aug 2008, M. Edward (Ed) Borasky wrote: > On Sun, 2008-08-24 at 02:31 +0900, Dave Bass wrote: >> But unfortunately Ruby regards both false and nil as not-true. For some >> reason, this is touted as a feature. >> >> False and nil are two quite different concepts and should not be >> conflated. > > Exactly! To make matters worse, Lisp "traditionally" treated nil as > false, but Scheme has "true", "false" and "nil" and nil is treated as > true in Scheme. > > So I don't have a problem with 0 not being false, but I do have a > problem with nil being false in Lisp and Ruby and true in Scheme. 0 is > 0, nil is nil, true is true and false is false and that is that! > > :) I understand what you're saying but I have a real, non-rhetorical question: In practical terms, what do you think should be done about such a situation? It seems to me that there are two possibilities: either computer languages really do things differently, including things like this (not just stylistic and/or cosmetic things), or they don't and then they all become the same. I can't think of a third possibility, and of course I like the first better than the second :-) David -- Rails training from David A. Black and Ruby Power and Light: Intro to Ruby on Rails January 12-15 Fort Lauderdale, FL Advancing with Rails January 19-22 Fort Lauderdale, FL See http://www.rubypal.com for details and updates!