Working with modules

Ali Çehreli acehreli at yahoo.com
Fri Feb 15 20:14:41 PST 2013


On 02/15/2013 07:50 PM, Jeremy DeHaan wrote:

 > I know that a module can only be defined once, but I feel like there
 > could be times where it would be helpful to be able to have the same
 > module defined in separate files

There may be other ways of achieving that and I haven't given much 
thought to your question but there is also the import expression:

   http://dlang.org/expression.html#ImportExpression

If needed, you can include D files similar to C's #include:

mixin (import ("part_of_my_module.d"));
mixin (import ("another_part_of_my_module.d"));

Ali



More information about the Digitalmars-d-learn mailing list