From: nobuyoshi nakada Date: 2006-01-16T17:45:41+09:00 Subject: Re: const_defined? behavior Hi At Mon, 16 Jan 2006 17:05:29 +0900, Daniel Amelang wrote in [ruby-talk:175899]: > Is this the intended behavior of const_defined? > > >> IO::SYNC > => 4096 > >> IO.const_defined? :SYNC > => false > > It appears that const_defined? only returns true if the class is the > originator of the constant. If the constant was borrowed from > somewhere else (in this case, File::Constants), it returns false. Yes. > That's on purpose, right? If that's the case, I must resort to > IO.constants.member?('SYNC') for my intended behavior, I suppose. > Seems a little strange. defined?(IO::SYNC) -- Nobu Nakada