On Thu, 12 Apr 2012 08:30:50 -0400, Xan <xancor...@gmail.com> wrote:
On Wednesday, 11 April 2012 at 19:50:18 UTC, Steven Schveighoffer wrote:
Now, you *can* possibly name the module differently using a module
statement, but this is highly discouraged. If you do this, the only
way another module can import your differently-named module is if you
pass the file on the command line.
But it's a messy limitation. Why we should have it? For C++
compatibilities?
No. C++ has no requirements for file names. But C++ also doesn't have a
module system. There are many benefits we get from having an actual
module system. For instance, D doesn't need namespaces.
The requirement is pretty straightforward -- name your module files after
the modules they contain. It works pretty well in many module-oriented
languages, such as Java and C#, and I would argue D.
-Steve