Clarification about compilation model and the mapping of package names to directory.

Claude via Digitalmars-d digitalmars-d at puremagic.com
Fri Apr 29 09:49:32 PDT 2016


> "supplying import module paths manually" ? How would that even 
> work? Suppose you want to compile main.d separately. You'd need 
> to supply to the compiler an option for each module with 
> non-standard path, such as `xxx.foo=foo.d;xxx.bar=bar.d`, etc..

No, the command-line option could be much simpler:
dmd -c myimplementation.d -Imyinterface.d

Just like when you compile and link both myimplementation.d and 
myinterface.d (and it resolves import locations on its own). 
Except you tell the compiler it just needs to look for 
declarations within myinterface.d, and not actually compiling it.



More information about the Digitalmars-d mailing list