The "module" declaration, and the name and path of D files do not need to match each other. You include a D file while compiling the project, and module declarations are cared only.

Based on above behaviour of design, allowing only one "module" keyword, and that is on top of D code file seems like a limitation to me (a little like just trying to copy Java, but leaving the work in the middle).

Is there any VERY SPECIAL reason behind that limitation? How hard would it be to add a syntax as below? What problems could it create?

test.d
----
module a{
}

module b{
   module c{
   }
}

Reply via email to