On Sun, 30 Jan 2005 14:50:49 +0900, William James <w_a_x_man / yahoo.com> wrote:
> 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

Please see the thread beginning at [ruby-talk:42410]. It's also
available on Google Groups from: http://qurl.net/ai

This was a question I asked over two years ago, and Hugh Sasse had
suggested some time before. I'm still of the opinion that it would be
interesting, but I'm less convinced that it's necessary. See, you can
also do:

  puts "yes" if x.between?(-5, 9)
  puts "yes" if (-5..9).include?(x)

-austin
-- 
Austin Ziegler * halostatue / gmail.com
               * Alternate: austin / halostatue.ca