From: matz@... (Yukihiro Matsumoto) Date: 1997-07-16T08:14:57+09:00 Subject: [ruby-list:3355] Re: [Q] eql? and == まつもと ゆきひろです In message "[ruby-list:3350] [Q] eql? and ==" on 97/07/15, Keiju ISHITSUKA writes: |けいじゅ@今はフリー(^^;;です. | |昔の話しですいませんが, eql? と == の関係を確認したいのです. |以前のメイルを遡ると(ドキュメント)も, | |[B] |def eql?(other) | self.equal?(other) |end | |にするという記述があるようなのですが?? あいや,まったく.直しておきます.とりあえず以下のパッチが有 効でしょう.superclassのバグも直ります. --- object.c~ Fri Jun 20 01:24:13 1997 +++ object.c Wed Jul 16 07:55:57 1997 @@ -401,6 +486,13 @@ - while (TYPE(super) == T_ICLASS) + while (TYPE(super) == T_ICLASS) { super = super->super; - + } + if (!super) { + return Qnil; + } +#ifdef RUBY_1_1 + return (VALUE)super; +#else return rb_class_path(super); +#endif } @@ -618,3 +710,3 @@ - rb_define_method(mKernel, "eql?", rb_equal, 1); + rb_define_method(mKernel, "eql?", obj_equal, 1); @@ -664,6 +759,8 @@ rb_define_private_method(cModule, "private_attr", mod_private_attr, -1); + rb_define_singleton_method(cModule, "new", mod_s_new, 1); rb_define_method(cClass, "new", class_s_new, -1); rb_define_method(cClass, "superclass", class_superclass, -1); rb_undef_method(cClass, "extend_object"); + rb_define_singleton_method(cClass, "new", class_s_new, -1);