From: Joel VanderWerf Date: 2008-02-29T08:30:57+09:00 Subject: Re: constants defined in Kernel are also defined in Object? Arlen Cuss wrote: > Hi, > > How about this? > >> And M is included by Foo, yet the analogy breaks down in the outputs of >> >> Object.const_defined?(:FOO) >> >> Foo.const_defined?(:FOO) > >>> Kernel.const_set(:FOO, 42) > => 42 >>> Class::FOO > => 42 >>> class Foo; end > => nil >>> Foo::FOO > => 42 But: Kernel.const_set(:FOO, 42) class Foo; end p Foo::FOO # ==> 42 p Foo.const_defined?(:FOO) # ==> false p Object.const_defined?(:FOO) # ==> true -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407