From: matz@... (Yukihiro Matsumoto) Date: 1997-08-26T12:06:24+09:00 Subject: [ruby-dev:259] Re: [BUG] MLF まつもと ゆきひろです In message "[ruby-dev:257] [BUG] MLF" on 97/08/26, Keiju ISHITSUKA writes: |けいじゅ@日本ラショナルです. | |MLF(meta lebel future)関係のバグレポートです. | |1. superclass | |相変わらずClass#superclassがバグっています. すみません.せっかく当てたパッチがどこかに消えています. |2. Class#new(superclass) |ちょっとおかしいようです. メタクラスの設定がしてありませんでした. |PS. |fail回り変更されましたか? 1.0の頃から$@が設定されていないと$!は見なかったはずです.で も,$@の設定は必須ではないように思えて来たので,修正します. --- object.c~ Mon Aug 18 17:15:38 1997 +++ object.c Tue Aug 26 11:42:31 1997 @@ -404,3 +404,3 @@ { - VALUE super; + VALUE super, cls; @@ -412,3 +412,7 @@ } - return class_new(super); + cls = class_new(super); + /* make metaclass */ + RBASIC(cls)->class = singleton_class_new(RBASIC(super)->class); + + return cls; } @@ -723,3 +727,4 @@ rb_define_method(cClass, "new", class_new_instance, -1); - rb_define_method(cClass, "superclass", class_superclass, -1); + rb_define_method(cClass, "superclass", class_superclass, 0); + rb_define_singleton_method(cClass, "new", class_s_new, -1); rb_undef_method(cClass, "extend_object"); --- eval.c~ Mon Aug 25 17:13:15 1997 +++ eval.c Tue Aug 26 11:52:09 1997 @@ -570,4 +570,6 @@ VALUE epath = rb_class_path(eclass); - fprintf(stderr, ": "); - fwrite(RSTRING(epath)->ptr, 1, RSTRING(epath)->len, stderr); + if (RSTRING(epath)->ptr[0] != '#') { + fprintf(stderr, ": "); + fwrite(RSTRING(epath)->ptr, 1, RSTRING(epath)->len, stderr); + } } @@ -2288,3 +2290,7 @@ - if (!NIL_P(mesg)) { + if (NIL_P(mesg)) { + mesg = errinfo; + Check_Type(mesg, T_STRING); + } + else { Check_Type(mesg, T_STRING);