- I always put a module statement in each source file. The module statement states the module name and the complete package name. For example:
- I always call a module the same name as its source file name.
- I always have the source files in the correct directory, based on the package name that is in their module statement. (For example, the file above would be called 'core.d', and it would be placed in the 'ui/' directory.)
- I always give the fully specified path/file to the DMD compiler (via the "build" utility).
- I always use "private import", though I can see myself relaxing this at odd times, if especially exceptional circumstances came up.
- I always use fully specified package and module names on the import statements.
BTW, the "multiplied defined module" message is very misleading.
Adapted from NG:digitalmars.D/16691 by Derek Parnell