From: Robert Klemme Date: 2010-08-24T00:20:42+09:00 Subject: Re: === is not a symmetric operator? 2010/8/23 Ralph Shnelvar : > Matz, > > Monday, August 23, 2010, 8:17:30 AM, you wrote: > > YM> Hi, > > YM> In message "Re: === is not a symmetric operator?" > YM>     on Mon, 23 Aug 2010 22:52:11 +0900, Ralph Shnelvar writes: > > YM> |Is my understanding correct that === is not a symmetric operator?  That, in fact, > YM> |  X === x > YM> |and > YM> |  x === X > YM> | > YM> |mean different things? > > YM> No. > > No!?!?!?! ... They do mean the same thing?!?!?!? > > Or ... "No, they do not mean the same thing."? Well, in a way they mean the same thing, i.e. method :=== is invoked on the left instance and the right instance is passed as argument. How :=== is implemented completely depends on the class (or even instance) at hand. Conventionally there is an implementation for Class and Module which tests for "instance of" relation. And for regular expressions :=== implements regexp matching. Etc. Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/