From: Brian Marick Date: 2008-08-25T02:02:42+09:00 Subject: Re: Why 'if 0' succeeds in Ruby On Aug 23, 2008, at 8:35 PM, M. Edward (Ed) Borasky wrote: > 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! Back in my Common Lisp days, some Lisper (George Carrette, I think) wrote about a dream he'd had. In it, he'd just written a fairly simple piece of Lisp code when he realized Scheme's strictness was right. The rest of the post was of the form: ... and then I realized that Scheme was right about X and my code had been taking advantage of Lisp's sloppiness. So I fixed that... The punch line was that every "fix" made the code longer and more complicated. It was brilliantly done, and I'm sad I've never been able to find it. One of the simplifications/complexifications was separating nil and false. ----- Brian Marick, independent consultant Mostly on agile methods with a testing slant www.exampler.com, www.exampler.com/blog, www.twitter.com/marick ----- Brian Marick, independent consultant Mostly on agile methods with a testing slant www.exampler.com, www.exampler.com/blog, www.twitter.com/marick