Jason Creighton wrote: > On Sat, 19 Jul 2003 14:58:51 +0900 > "Kurt M. Dresner" <kdresner / cs.utexas.edu> wrote: > > >>When I learned python I was overjoyed that I could evaluate 1 < 2 < 3 >>and get "true". I just realized that you can't do that in Ruby. Is >>there a reason why? Is it good? I know I can use "between", but >>still... > > > http://www.rubygarden.org/article.php?sid=286 > > So basically, it's because it's hard to implement, even more so because > true/false/nil are singleton objects. (So you can't, for instance, save state > in a particular instance of 'true', because there's only one.) As you say, there is only one true; but you still can save state in it: irb(main):001:0> true.instance_eval {@x = 1} 1 irb(main):002:0> true.instance_eval {@x} 1 Not that it's relevant to the 1 < 2 < 3 discussion, but it's kinda cute...