From: k Date: 2002-06-14T22:13:08+09:00 Subject: referring to variables in the scope outside the def When defining a singleton method, I want to refer to variables in the scope outside the def. Is it possible to do something like the following? class C def initialize @child = Object.new s = self def @child.parent s # Wrong. But how do I refer to the instance of C? end end attr_reader :child end c = C.new c == c.child.parent # Should be true. Any hints? I think I'm missing a vital piece of magic here. Or maybe I'm expecting too much Lisp-ness. k