From: richB Date: 2006-08-09T11:45:10+09:00 Subject: Re: For Float#class why is '===' different from '==' I appreciate the responses. I'm still puzzled. It seems that "case a" is different from "case a.class" and that the comparison being done by "===" in when is influenced by the type/class of the when operand. I guess I wasn't expecting this. I am still trying to iron out my conceptual understanding. Is it that "case a" is asking about the object a, whereas "case a.class" is asking about the object/attribute a.class. Clearly a is Float but a.class is something else that evaluates to Float? irb(main):001:0> a=2.3 => 2.3 irb(main):002:0> case a.class irb(main):003:1> when Float then puts "match" irb(main):004:1> end => nil irb(main):005:0> a=2.3 => 2.3 irb(main):006:0> case a irb(main):007:1> when Float then puts "match" irb(main):008:1> end match => nil irb(main):009:0> a.class => Float irb(main):010:0> case a irb(main):011:1> when 2.3 then puts "match" irb(main):012:1> end match => nil Thanks!