From: "Chr. Rippel" Date: 2002-01-12T09:45:07+09:00 Subject: Re: class name reported differently in different contexts "ts" wrote in .... > With this patch, classid is useless and even for "native" classes it can > exist only classpath. Sorry Guy the first example from my previous post was a little bit bogus. What I mend that to say if you consider a script like ------ class Module private def const_get_scoped sym if sym.is_a? (Symbol) Object.__const_get_scoped (sym.to_s) else Object.__const_get_scoped sym end end protected def __const_get_scoped sym if md = (/(::)/).match(sym) (const_get (md.pre_match)).__const_get_scoped md.post_match else const_get sym end end end class Klass def self.inherited(sub_klass) const_get_scoped (sub_klass.inspect) end end class X class Y begin class Z < Klass; end rescue NameError => mes puts mes end end end ------ than the output would be something like 1) uninitialized constant Z 2) uninitialized constant Z at X::Y 3) wrong constant name # depending on what strategy is implemented. I am really not sure why you think the first strategy is so much better. For better or for worse if an exception occurs during the call to #inherited a Class object exists until the garbage collector kicks in and there nothing you can do about this. /Christoph