module keyword with curly brackets

tcak via Digitalmars-d digitalmars-d at puremagic.com
Sat Nov 1 00:52:38 PDT 2014


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{
    }
}


More information about the Digitalmars-d mailing list