From: matz@... (Yukihiro Matsumoto) Date: 1998-12-01T18:00:56+09:00 Subject: [ruby-dev:3721] Re: new delegator まつもと ゆきひろです In message "[ruby-dev:3720] Re: new delegator" on 98/12/01, 石塚圭樹 writes: |けいじゅ@日本ラショナルソフトウェアです. |> rescue Exception |> n = if /:in `__getobj__'$/ =~ $@[0] then 1 else 2 end #` |> $@[1,n] = nil |> raise |> end |>end | |この辺りが問題ありのままです. あ,忘れてた.でも,本体にパッチ当てる必要がありました. --- eval.c 1998/11/17 09:12:30 1.1.1.2.2.82 +++ eval.c 1998/12/01 07:17:49 @@ -387,3 +387,6 @@ -#define POP_FRAME() the_frame = _frame.prev; } +#define POP_FRAME() \ + sourcefile = _frame.file; \ + sourceline = _frame.line; \ + the_frame = _frame.prev; } でもって変更したdelegate.rbです -- # Delegation class that delegates even methods defined in super class, # which can not be covered with normal method_missing hack. # # Delegator is the abstract delegation class. Need to redefine # `__getobj__' method in the subclass. SimpleDelegator is the # concrete subclass for simple delegation. # # Usage: # foo = Object.new # foo2 = SimpleDelegator.new(foo) # foo.hash == foo2.hash # => true # # Foo = DelegateClass(Array) # # class ExtArray true foo.test # raise error! end