From: Pit Capitain Date: 2002-02-01T23:39:16+09:00 Subject: Re: strange behavior On 1 Feb 2002, at 23:02, mengx@nielsenmedia.com wrote: > As Dave mentioned, "include" use a proxy for the included module. it > seems to me that the subclassing uses the similar implementation > > class A > AA = 1 > end > > class B < A > BB = 1 > class C > puts BB => 1 > puts AA => NameError > end > > end > > B.constants => AA .. > > As I mentioned for the module issue, my point is that apparently, when > B looks up for constants, it searches the proxy since it is regarded > as part of B. When C asks B for its constants, B does not search its > proxy. No matter how they are implemented in Ruby C interpreter, at > runtime, both BB and AA should have the same accessibility, which is > what an inheritance is supposed to do, isn't it? > > Thanks > > -Ted I didn't thoroughly follow the many posts in this thread, but I think the answers to "why is it behaving like this" questions and other results should be written down somewhere, maybe in the FAQ or at RubyGarden. Volunteers? :-) Thanks in advance, Pit