From: Xavier Noria Date: 2010-03-04T07:45:34+09:00 Subject: Re: Class vs Module in constant lookup On Wed, Mar 3, 2010 at 8:01 PM, Peter McLain wrote: > Constant lookup behaves differently if there is a class versus a > module in the name: > >    XYZ = 10 > >    module M >    end > >    class C >    end > >    p defined? M::XYZ  # => nil >    p defined? C::XYZ  # => "constant" > > Is this difference intended? If so, what is the rationale? I believe C::XYZ works because C is a subclass of Object.