"William James" <w_a_x_man / yahoo.com> 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.

-- 
Christian Neukirchen  <chneukirchen / gmail.com>  http://chneukirchen.org