From: Charles Oliver Nutter Date: 2011-01-12T00:03:50+09:00 Subject: [ruby-core:34353] Re: [Ruby 1.9-Bug#4168] WeakRef is unsafe to use in Ruby 1.9 On Tue, Jan 11, 2011 at 3:08 AM, Kurt Stephens wrote: > Issue #4168 has been updated by Kurt ��Stephens. > > > See commit in branch from trunk: > > http://github.com/kstephens/ruby/commit/0942a955c649c39d3be4db13dbfb0bacfd634994 > > Probably not the same API as WeakReference. It's more similar to Java's WeakReference than Ruby's. Ruby's uses Delegate, so that method dispatches can go through the WeakRef object as though it weren't there. Personally, I find this a *terrible* idea, since code could get a weak reference error at any time, when not expecting it. Requiring a user to actually traverse the weakref before invoking makes it clear that there's an intermediate result involved. Obviously your version doesn't use Delegate at all. ruby-core would need to decide whether this would be an official external class upon which the more "feature-rich" WeakRef would build, or whether this should actually become WeakRef, Delegate and all. - Charlie