From: David Alan Black Date: 2002-07-11T05:32:26+09:00 Subject: Re: Resurrection of the const_added (was class_added) RCR; Re: self_parent Hello -- On Thu, 11 Jul 2002, Christoph wrote: > Hi, > > this is a resurrection attempt of Michal Rokos class_added RCR > [ruby-talk:38044] in the modified form of a const_added - see for > example Matz response in [ruby-talk:38713] > > > I'm not going to implement every possible hook. So when somebody > > comes with more concrete usage, I will consider this again. It would > > be const_added, not class_added. > > Implementing this RCR would make it easier to accommodate Tom's > inner class style programming. For example, by manipulating by > OuterClass#const_added of a Class > > class OuterClass > class AnInnerClass > # deeper .. > end > # more inner classes > > end > > would ensure that calling OuterClass::AnInnerClass.new would > automatically generate an instance variable @parent_instance > variable of type OuterClass. I'm can't quite follow this. Wouldn't const_added get called when a constant is added to OuterClass? class OuterClass def const_added(name,value) # or something ... end NEW_CONSTANT = 1 # const_added called here end If so, how would this interact with inner classes? David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav