From: Christian Neukirchen Date: 2005-01-31T00:31:26+09:00 Subject: Re: nil question "David A. Black" writes: > Hi -- > > On Sun, 30 Jan 2005, Christian Neukirchen wrote: > >> "William James" writes: >> >>> Sam Roberts wrote >>>> In ruby, zero and empty strings are true >>> >>> Since 0 is true, you should be able to do this in Ruby: >>> >>> puts "yes" if -5 < x < 9 >>> >>> The phrase '-5 < x' should yield the value of x instead of true. >>> That's the way it actually works in the Icon programming language. >>> But we have to use the klunky >>> >>> puts "yes" if -5 < x and x < 9 >>> >> >> Erm, say, x is -16: >> >> (-5 < x) < 9 >> (-5 < -16) < 9 >> -5 < 9 >> -5 >> >> -5 is true, probably not what you want. > > But -5 < -16 is not true, so it wouldn't get that far. (I assume > William means it should return x if the expression is true, false > otherwise.) So false is bigger than 9? Math books will need to be rewritten. :-) -- Christian Neukirchen http://chneukirchen.org