From: Paul Brannan Date: 2001-11-27T03:48:05+09:00 Subject: [ruby-talk:26536] Re: delegates and weakref On Tue, 27 Nov 2001, Yukihiro Matsumoto wrote: > It's the limitation. WeakRef is not a "cooked" class, i.e. it doesn't > complete without specifying target in the "initialize". So, I'm not sure I understand what you mean by "cooked." I am calling WeakRef.new, which should call initialize, right? Looking at the WeakRef source, I can see that WeakRef is a Delegator. So I thought I'd try the same exercise, trying to delegate to a delegate: require 'delegate' class Foo def method_missing(*args) p args end end class Bar < DelegateClass(Foo) def initialize super(Foo.new) end end class ABC < DelegateClass(Bar) def initialize super(Bar.new) end end b = ABC.new # BTW, is there a better name for a class when Foo and Bar # are already taken? b.foo With this I get the same error: mm.rb:22: undefined method `foo' for # (NameError) Is this a fixable problem or is it really a fundamental limitation? Paul