Working with modules

Jonathan M Davis jmdavisProg at gmx.com
Fri Feb 15 02:00:04 PST 2013


On Friday, February 15, 2013 10:51:00 Colin Grogan wrote:
> Does anyone here have any alternatives for me so that in my
> 'engine' or 'main' classes I can simply write:
> 
>      import utils;
> 
> and still have my source files neatly laid out in manageable
> chunks?

The only way that you can have a single import which imports multiple modules 
is if the module that you're importing publicly imports the other modules. And 
there is no way to do something like

import utils.*;

And remember that modules always correspond to files, and packages correspond 
to folders, so there's a one-to-one correspondance between what you'd import 
and what you'd put in the file system (unless you use public imports to make it 
so that importing a module imports stuff from outside that module).

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list