From: matz@... (Yukihiro Matsumoto) Date: 1999-09-22T00:41:18+09:00 Subject: [ruby-list:16981] Re: nested module file まつもと ゆきひろです In message "[ruby-list:16974] nested module file" on 99/09/21, Kazuhiro Yoshida writes: |module_eval の場合も eval と同様に, | (module_eval):3:in `initialize': ...(省略) |という表示になったほうがいいのではないかと思います. 以下のパッチでそうなります。 --- /tmp/eval.c Wed Sep 22 00:00:48 1999 +++ eval.c Wed Sep 22 00:10:46 1999 @@ -4490,3 +4494,3 @@ { - char *file = 0; + char *file = "(eval)"; int line = 1; |さて,「別々のファイルに用意した module を入れ子に」する方法とし |ては,ほかにいい方法はありますか? # こっちが本題だったりする^^; -- mod_root.rb module Root ... end -- mod_child.rb require 'mod_root.rb' module Root class Child def initialize ... end end end -- mod_test.rb require 'mod_child c = Root::Child.new -- なんて感じでどうでしょう? まつもと ゆきひろ /:|)