On Saturday, 1 November 2014 at 07:52:39 UTC, tcak wrote:
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{
}
}
I find this, and the fact that packages and modules map directly
to directories and files, to be an arbitrary limitation as well.
It was discussed briefly in Adam Wilson's talk at DConf 2013
"From C# to D" (http://www.youtube.com/watch?v=6_xdfSVRrKo). I
also don't see any reason for there to be both packages and
modules. But after about a year observing the culture of this
community, I don't believe any of this will ever change unless
the language is forked, in which case it will really no longer be
D.
Mike