4 ms·
defined? behaves completely correct in respect to naming conventions. It's behavior is notable in a different way: It's one of the few places where undefined co
by Xylakant 14y ago
defined? behaves completely correct in respect to naming conventions. It's behavior is notable in a different way: It's one of the few places where undefined constants can appear in the code without raising an exception:
jruby-1.6.8 :089 > defined? Foo::Bar
=> nil
jruby-1.6.8 :090 > Foo::Bar
NameError: uninitialized constant Foo::Bar