how do languages which allow multiple (nested) modules in a single file deal with imports, and relating module names to file paths?
e.g. if you have modules A & B with A containing B, is B available (if exported) as A.B?
what if src/A/B.blah exists too?
Conversation
In Rust, you have two forms. a can contain "mod b;" which declares that there's another file defining the module b, or a can contain "mod b {}" which is an inline definition of the module. The former has a default search path for where it expects the file, but it can be overriden
1
2
If you try to have both in the same file it will complain that you're trying to define the same module twice.
2
3
Yeah I like this approach! It's handy for conditional compilation and commenting out the `mod A;` things to remove it temporarily.


