From: Alexandre Mutel Date: 2009-12-01T08:10:40+09:00 Subject: Re: Problem trying to get a constant with correct scope pharrington wrote: > On Nov 30, 5:47�pm, Alexandre Mutel wrote: >> � � � � result = lookup_in.const_get sym >> But that's a very bad option in terms of performance... I'm wondering if >> there are any other options? >> -- >> Posted viahttp://www.ruby-forum.com/. > > As far as I know the only way to do this is to traverse the > inheritance hierarchy :\ Ok, so that's a bad news... Rob wrote: >Would your DSL rather do something with const_missing instead of >method_missing? (see Module#const_missing) I suppose that you could >set A::C::B = A::B >-Rob Nope, because the block I'm trying to evaluate is "A_CONSTANT some,parameters", so i expect to parse the parameters as well for this constant. Moreover, the const_missing doesn't solve the issue as i still have to lookup through parent's modules to get the constant dynamically as it is performed statically... -- Posted via http://www.ruby-forum.com/.