[#22503] can't require — IWATSUKI Hiroyuki <don@...>

岩月と申します。

94 messages 2004/01/06
[#22504] Re: can't require — nobu.nakada@... 2004/01/06

なかだです。

[#22505] Re: can't require — matz@... (Yukihiro Matsumoto) 2004/01/06

まつもと ゆきひろです

[#22506] Re: can't require — IWATSUKI Hiroyuki <don@...> 2004/01/06

岩月と申します。

[#22509] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/07

山本です。

[#22513] Re: can't require — IWATSUKI Hiroyuki <don@...> 2004/01/07

岩月と申します。

[#22514] Re: can't require — nobu.nakada@... 2004/01/07

なかだです。

[#22522] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/07

山本です。

[#22524] Re: can't require — nobu.nakada@... 2004/01/07

なかだです。

[#22526] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/07

山本です。

[#22534] Re: can't require — nobu.nakada@... 2004/01/07

なかだです。

[#22535] Re: can't require — matz@... (Yukihiro Matsumoto) 2004/01/07

まつもと ゆきひろです

[#22536] Re: can't require — Tanaka Akira <akr@...17n.org> 2004/01/07

In article <1073474004.933446.5475.nullmailer@picachu.netlab.jp>,

[#22540] Re: can't require — nobu.nakada@... 2004/01/07

なかだです。

[#22541] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/07

山本です。なかださんのコードで気になった点が3つあります。

[#22546] Re: can't require — nobu.nakada@... 2004/01/07

なかだです。

[#22549] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/08

山本です。

[#22550] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/08

山本です。

[#22551] Re: can't require — nobu.nakada@... 2004/01/08

なかだです。

[#22571] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/11

山本です。

[#22667] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/22

山本です。

[#22668] Re: can't require — matz@... (Yukihiro Matsumoto) 2004/01/22

まつもと ゆきひろです

[#22669] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/22

山本です。

[#22676] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/24

山本です。

[#22677] Re: can't require — matz@... (Yukihiro Matsumoto) 2004/01/25

まつもと ゆきひろです

[#22678] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/25

山本です。

[#22679] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/25

山本です。

[#22680] Re: can't require — matz@... (Yukihiro Matsumoto) 2004/01/25

まつもと ゆきひろです

[#22682] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/25

山本です。

[#22683] Re: can't require — matz@... (Yukihiro Matsumoto) 2004/01/25

まつもと ゆきひろです

[#22686] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/26

山本です。

[#22687] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/26

山本です。

[#22697] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/27

山本です。

[#22700] Re: can't require — nobu.nakada@... 2004/01/27

なかだです。

[#22712] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/27

山本です。WinCVS + byacc + sed をインストールして、ビルドできるようになりました。

[#22714] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/27

山本です。

[#22716] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/27

山本です。

[#22725] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/28

山本です。

[#22729] Re: can't require — matz@... (Yukihiro Matsumoto) 2004/01/28

まつもと ゆきひろです

[#22734] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/28

山本です。

[#22736] Re: can't require — matz@... (Yukihiro Matsumoto) 2004/01/28

まつもと ゆきひろです

[#22738] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/28

山本です。

[#22739] Re: can't require — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/28

山本です。

[#22740] Dir.glob (Re: Re: can't require) — nobu.nakada@... 2004/01/28

なかだです。

[#22741] Re: Dir.glob (Re: Re: can't require) — matz@... (Yukihiro Matsumoto) 2004/01/28

まつもと ゆきひろです

[#22744] Re: Dir.glob (Re: Re: can't require) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/28

山本です。

[#22746] Re: Dir.glob (Re: Re: can't require) — nobu.nakada@... 2004/01/28

なかだです。

[#22747] Re: Dir.glob (Re: Re: can't require) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/28

山本です。

[#22748] Re: Dir.glob (Re: Re: can't require) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/28

山本です。

[#22750] Re: Dir.glob (Re: Re: can't require) — matz@... (Yukihiro Matsumoto) 2004/01/28

まつもと ゆきひろです

[#22761] Re: Dir.glob (Re: Re: can't require) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/29

山本です。

[#22764] Re: Dir.glob (Re: Re: can't require) — nobu.nakada@... 2004/01/29

なかだです。

[#22766] Re: Dir.glob (Re: Re: can't require) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/29

山本です。

[#22770] Re: Dir.glob (Re: Re: can't require) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/29

山本です。

[#22772] Re: Dir.glob (Re: Re: can't require) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/01/29

山本です。

[#22774] Re: Dir.glob (Re: Re: can't require) — matz@... (Yukihiro Matsumoto) 2004/01/29

まつもと ゆきひろです

[#22688] output directory for extensions — nobu.nakada@...

なかだです。

14 messages 2004/01/26

[#22691] 次期リリースでの新規添付ライブラリ — "Kawaji, Shinya" <kawaji@...>

かわじ、です

18 messages 2004/01/26
[#22693] Re: 次期リリースでの新規添付ライブラリ — matz@... (Yukihiro Matsumoto) 2004/01/26

まつもと ゆきひろです

[#22694] Re: 次期リリースでの新規添付ライブラリ — matz@... (Yukihiro Matsumoto) 2004/01/26

まつもと ゆきひろです

[#22763] $: trick in test/* — "NAKAMURA, Hiroshi" <nakahiro@...>

なひです。

21 messages 2004/01/29

[ruby-dev:22593] Re: marshaling a class which is defined under singleton class

From: nobu.nakada@...
Date: 2004-01-16 02:56:08 UTC
List: ruby-dev #22593
なかだです。

At Fri, 16 Jan 2004 02:19:30 +0900,
Tanaka Akira wrote:
> 
> 次のように、特異クラス内で定義したクラスを marshal するとエラーが出ま
> す。それはいいのですが、load 時なのは変で dump 時なんじゃないでしょう
> か。
> 
> % ruby -e '
> class << Object.new
> class C
> end
> Marshal.load(Marshal.dump(C))
> end
> '
> -e:5:in `load': undefined class/module Object::C (ArgumentError)
>         from -e:5

というより、これは別物になっています。

class C
  def c
    "C in toplevel"
  end
end

class << Object.new
  class C
    def c
      "C in singleton"
    end
  end
  c = C.new
  p c.c
  p Marshal.load(Marshal.dump(c)).c
end

クラス名からちゃんと復元できるか確認すべきかも。


Index: marshal.c
===================================================================
RCS file: /cvs/ruby/src/ruby/marshal.c,v
retrieving revision 1.110
diff -u -2 -p -d -r1.110 marshal.c
--- marshal.c	27 Dec 2003 16:07:43 -0000	1.110
+++ marshal.c	16 Jan 2004 02:54:26 -0000
@@ -99,4 +99,17 @@ struct dump_call_arg {
 };
 
+static VALUE
+class2name(klass)
+    VALUE klass;
+{
+    VALUE path = rb_class_path(klass);
+    char *n = RSTRING(path)->ptr;
+
+    if (rb_path2class(n) != klass) {
+	rb_raise(rb_eArgError, "%s cannot be referfed", n);
+    }
+    return path;
+}
+
 static void w_long _((long, struct dump_arg*));
 
@@ -383,5 +396,5 @@ w_class(type, obj, arg, check)
     w_extended(klass, arg, check);
     w_byte(type, arg);
-    path = rb_class2name(klass);
+    path = RSTRING(class2name(klass))->ptr;
     w_unique(path, arg);
 }
@@ -398,5 +411,5 @@ w_uclass(obj, base_klass, arg)
     if (klass != base_klass) {
 	w_byte(TYPE_UCLASS, arg);
-	w_unique(rb_class2name(klass), arg);
+	w_unique(RSTRING(class2name(klass))->ptr, arg);
     }
 }
@@ -518,5 +531,5 @@ w_object(obj, arg, limit)
 	    w_byte(TYPE_CLASS, arg);
 	    {
-		VALUE path = rb_class_path(obj);
+		VALUE path = class2name(obj);
 		if (RSTRING(path)->ptr[0] == '#') {
 		    rb_raise(rb_eTypeError, "can't dump anonymous class %s",
@@ -530,5 +543,5 @@ w_object(obj, arg, limit)
 	    w_byte(TYPE_MODULE, arg);
 	    {
-		VALUE path = rb_class_path(obj);
+		VALUE path = class2name(obj);
 		if (RSTRING(path)->ptr[0] == '#') {
 		    rb_raise(rb_eTypeError, "can't dump anonymous module %s",


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

In This Thread