[#23717] error at TestDRbMServer (test/drb) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>

山本です。どうしても原因がわからないので、報告だけ・・・

18 messages 2004/06/19
[#23718] Re: error at TestDRbMServer (test/drb) — nobu.nakada@... 2004/06/19

なかだです。

[#23719] Re: error at TestDRbMServer (test/drb) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/06/19

山本です。

[#23720] Re: error at TestDRbMServer (test/drb) — nobu.nakada@... 2004/06/19

なかだです。

[#23724] Re: error at TestDRbMServer (test/drb) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/06/19

山本です。

[#23762] Ruby 1.8.2 to be released. — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです

40 messages 2004/06/23

[#23784] URI() — Tanaka Akira <akr@...17n.org>

前から思っていたのですが、URI.parse("http://...") を URI("http://...")

19 messages 2004/06/25

[ruby-dev:23690] singleton class inherits the object's class.

From: nobu.nakada@...
Date: 2004-06-15 11:04:22 UTC
List: ruby-dev #23690
なかだです。

http://mput.dip.jp/mput/?date=20040615#p05 のエラーの件ですが、
特異クラスが特異オブジェクトのクラスを継承していると見なされて
いるようです。

  $ ruby-1.8 -v -e 'class X;end; x=X.new; class << x;p self < X; end'
  ruby 1.8.2 (2004-06-14) [i686-linux]
  true

  $ ruby-1.9 -v -e 'class X;end; x=X.new; class << x;p self < X; end'
  ruby 1.9.0 (2004-06-14) [i686-linux]
  true

特異クラスは特別扱いする必要があるんじゃないでしょうか。


* object.c (rb_class_inherited_p): singleton class inherits Class
  rather than its object's class.


Index: object.c
===================================================================
RCS file: /var/cvs/src/ruby/object.c,v
retrieving revision 1.151
diff -u -2 -p -r1.151 object.c
--- object.c	14 May 2004 16:39:15 -0000	1.151
+++ object.c	15 Jun 2004 10:58:38 -0000
@@ -1258,4 +1258,9 @@ rb_class_inherited_p(mod, arg)
     }
 
+    if (FL_TEST(mod, FL_SINGLETON)) {
+	if (RCLASS(mod)->m_tbl == RCLASS(arg)->m_tbl)
+	    return Qtrue;
+	mod = RBASIC(mod)->klass;
+    }
     while (mod) {
 	if (RCLASS(mod)->m_tbl == RCLASS(arg)->m_tbl)


-- 
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
    中田 伸悦

In This Thread

Prev Next