From: ara.t.howard@... Date: 2006-06-16T01:49:55+09:00 Subject: Re: Why the lack of mixing-in support for Class methods? On Fri, 16 Jun 2006, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: Why the lack of mixing-in support for Class methods?" > on Fri, 16 Jun 2006 00:50:43 +0900, ara.t.howard@noaa.gov writes: > > | p M::class_extension::const_get(:File) # File > | p M::class_extension::File # exception! > > The difference here is caused because a class statement with in > module_eval defines a constant in the innermost surrounding class / > module (M, this case) in 1.8, and const_get looks ancestors for > constants by default, where double colons do not. > > In 1.9, a class statement in module_eval defines a constant in the > target module (anonymous class_extension module in this case). So > that it gives: > > File > File > my_file > my_file > /tmp/c.rb:42: warning: toplevel constant File referenced by M::File > File > File > my_file > my_file > > for 1.9 that means the new File class is defined under anonymous > class_extension module. It seems more consistent and simple. yes it does. that makes me feel better. thanks for the explanation. -a -- suffering increases your inner strength. also, the wishing for suffering makes the suffering disappear. - h.h. the 14th dali lama