From: Christophe Grandsire Date: 2005-10-26T05:05:22+09:00 Subject: Re: Comparing Classes with Case ? En r�ponse � Jacob Fugal : > > On the right track, but it's actually the right argument. That is: > > irb(main):001:0> String === "string" > => true > You're right of course! I keep forgetting that order :( . > That's because the left hand side is the receiver (=== is just another > method). When the receiver is a Class, Class#=== is called. > > irb(main):002:0> String.===( "string" ) > => true > It makes sense, but I still have difficulties remembering it :( . > > A when clause for a case statement evaluates using === with the when > argument as the receiver and case argument as argument. So: > Yes, and although the order makes sense, from a functional point of view, it is difficult to get my head around the idea that case indicates the argument rather than the receiver. -- Christophe Grandsire. http://rainbow.conlang.free.fr You need a straight mind to invent a twisted conlang.