From: Tom Sawyer Date: 2002-07-05T23:37:25+09:00 Subject: Re: self_parent by the way, this idea actually stems from an earlier desire to have objects created by nested class definitions inherit their parent class instance. see: http://www.rubygarden.com/article.php?sid=236 just trying to solve the age old question: "are you my mother?" - p.d.eastman okay, i just opened myself up to all sorts of trouble now. ~transami :-) On Fri, 2002-07-05 at 05:31, Massimiliano Mirra wrote: > On Fri, Jul 05, 2002 at 07:49:09AM +0900, Tom Sawyer wrote: > > no need to pass self and explicitly store it. so there's a fictional > > example for you. in the real world there are many cases of such a > > parent-child relationship. > > C'mon, for an object to be coupled to the one where it was created is > still a specific case, not the general one. I don't think that in > `puts "hello, world"' you want the string to be coupled to the object. > Instead I think you'll want the coupling to be as clear as possible to > who reads the code, and both `x = X.new(self)' and `x.parent = self' > do this pretty good, don't they? > > Massimiliano > -- ~transami "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -- Benjamin Franklin