From: Caleb Clausen Date: 2010-03-24T02:42:50+09:00 Subject: [ruby-core:28893] Re: WeakRef extending Delegator is a bug waiting to happen? On 3/22/10, Thomas E Enebo wrote: > On Mon, Mar 22, 2010 at 1:59 PM, Charles Oliver Nutter > wrote: >> Hopefully this doesn't contradict my other email too much :) >> >> In talking with Tom Enebo about Ruby's WeakRef implementation, we >> concluded that it's generally not a good idea to use WeakRef like a >> Delegator. In fact, it seems like WeakRef should not extend Delegator >> at all. [snip] > Conclusion: Feature that can easily lead to unintended consequences. > Weak references are needed, but should it do anything more than point > to an object and be able to retrieve said object if it is still alive? I think you are correct. I've vaguely worried about this before, without being quite sure what it was that was bothering me. Thank you for hitting it on the head. You make a good case that WeakRef should not descend from Delegator, no matter how convenient it might seem.