Re: module MyMod::MyOtherMod question
- From: Brian Candler <b.candler@xxxxxxxxx>
- Date: Thu, 30 Sep 2010 12:12:47 -0500
Gene Angelo wrote:
Gene Angelo wrote:
[I] assumed these were synonymous, but they are not:
I stand corrected. It appears that in order to use the following syntax:
module A::B
...
end
module A must be defined.
Yes. But even then,
module A; end
module A::B
...
end
is different to
module A
module B
...
end
end
in the way that constants are looked up.
=> 123module A; FOO = 123; end
NameError: uninitialized constant A::B::FOOmodule A::B
puts FOO
end
from (irb):3
from :0
123module A; module B
puts FOO
end; end
=> nil
--
Posted via http://www.ruby-forum.com/.
.
- References:
- module MyMod::MyOtherMod question
- From: Gene Angelo
- Re: module MyMod::MyOtherMod question
- From: Gene Angelo
- module MyMod::MyOtherMod question
- Prev by Date: Re: Color sequences in ri on Windows
- Next by Date: Re: ruby-1.9.2-p0 fails to to build
- Previous by thread: Re: module MyMod::MyOtherMod question
- Next by thread: rvm install problems on Ubuntu 10.04
- Index(es):