On Wednesday, 18 February 2015 at 07:34:13 UTC, Daniel Kozák wrote:

On Wed, 18 Feb 2015 07:23:24 +0000
Muahmmad Adel via Digitalmars-d-learn
<digitalmars-d-learn@puremagic.com> wrote:

I have searched online and I found no way for dividing D Module between multiple files.


You are not force to do so I do not see any trouble here.

For eg. I have lots of file where I have only one class (similar to
java concept).

The problem with this approach is that you will end with ugly class names like mypackage.myclass.MyClass.

I'm porting some C# code where I need the type name at runtime and I ended with a huge package.d file just to keep pretty names like mypackage.MyClass.

Another way to trick the compiler is to mixin import all modules in the package.d file but you'll loose features like code completion in your editor.

Reply via email to