From: george.marrows@... Date: 2003-12-02T01:21:19+09:00 Subject: Re: Constants, class variables and the cbase field > g> the result is counter-intuitive. My guess would have been > that class > g> B::C is strictly short-hand for class B; class C, with the > same constant > g> lookups. > > Well, imagine that someone write > > D = B::C > > class D > end > > how ruby can find that D was B::C and make it work like > class B; class C Hmm, well .. I didn't know you could do that :) But anyway .. the subtext of my original post was "why doesn't a class simply record who its nesting parent is?" If this info was available, then D (= B::C) knows that its parent is B and lookup can go C, B, A. There are currently 3 class-related hierarchies in Ruby: inheritance, class nesting and source layout. I guess what I'm getting at is: let's forget about source layout and just use the first two. Doubtless there are subtleties that screw this up .. -- George