From: keiju@... (=?ISO-2022-JP?B?GyRCQFBETTc9PHkbKEI=?= ) Date: 1998-11-20T18:46:46+09:00 Subject: [ruby-list:10995] Re: case with Class けいじゅ@日本ラショナルソフトウェアです. In [ruby-list :10992 ] the message: "[ruby-list:10992] Re: case with Class ", on Nov/20 18:14(JST) "豊福" writes: > 豊福@パパイヤです。 > 試しに > case String.cond(:==) > when String; print "string\n" > else; print "else\n" > end >でやってみましましたが期待どおりにいきませんでした。 > String#=== ではなく Kernel#=== が呼ばれる(はずの) >仕組がわからないのですがどういう仕掛なんですか。 あぁっ... その通りですね. この方法では, サブクラスで===が再定義されていると駄目 ですね... >> def call(other) >> @receiver.send(@method, other) >> end > > ここは === に合わせて > other.send(@method, @receiver) >でしょうか。 むむむ. 確かにそうかも(*^^* 失礼しました(__;;; __ ................................石塚 圭樹@日本ラショナルソフトェア... ----------------------------------->> e-mail: keiju@rational.com <<---