Russ Cordner wrote:
> I have the following code fragment:
> 
> i = 1
> j = case i
>  when 1
>   true
>  else
>   false
>  end
> 
> I would expect j to equal true after the run, but it equals nil. If I
> change the return values to anything else but true and false, it works
> as expected. Am I missing some special handling of true and false?
> Thanx.

I just tried this, and couldn't replicate your result.  What Ruby are 
you using?

$ irb -v
irb 0.9.5(05/04/13)
$ irb
irb(main):001:0> i = 1
=> 1
irb(main):002:0> j = case i
irb(main):003:1>  when 1
irb(main):004:1>   true
irb(main):005:1>  else
irb(main):006:1*   false
irb(main):007:1>  end
=> true
irb(main):008:0> true ? true : false
=> true
irb(main):009:0> false ? true : false
=> false
irb(main):006:0> 1 ? true : false
=> true
irb(main):005:0> nil ? true : false
=> false
-- 
Posted via http://www.ruby-forum.com/.