From: Yasushi Shoji Date: 2000-09-26T11:25:02+09:00 Subject: [ruby-talk:5120] Re: Types and === At Tue, 26 Sep 2000 09:55:14 +0900, Hal E. Fulton wrote: > Still, it bothers me a little that x==y does not always > imply x===y. But I will just have to get used to that... how about stating: '===' does not imply '==' at all. '===' is defined in each class the way to make writing case statement easier. most classes use '==' for '===', but some class, such as class Class and class Range uses other.is_a?(self) and self.include?(other), respectively. > Actually I have trouble remembering what === means -- > whether to say x === y or y === x, which are of course > not the same. so, i guess you don't have to remember what '===' at all ;) I think the moment you need to remember about '===' is when you write your own class. you can define '===' in your own class to control case statement. -- yashi