From: ts Date: 2003-12-08T23:29:49+09:00 Subject: Re: WeakRef and Object#hash >>>>> "R" == Robert Klemme writes: R> Hm, not sure what exactly you mean. matz is trying to say that it's hard to know if a variable will be gc'ed, because internally ruby can have reference to the object that you are not aware. R> I was assuming, the line R> wr = WeakRef.new Object.new R> leads to exactly one ref (the weak ref to be precise) to the instance. yes, it has only one ref. Now write it (like in the original example) class WeakRef; end wr = WeakRef.new Object.new and if you are lucky the variable will not be gc'ed because internally ruby has a reference to it. Guy Decoux