Clarification about compilation model and the mapping of package names to directory.
Jesse Phillips via Digitalmars-d
digitalmars-d at puremagic.com
Fri Apr 29 09:34:44 PDT 2016
On Friday, 29 April 2016 at 14:54:30 UTC, Marco Leise wrote:
> It is de facto allowed, yes. But if it only works in
> compile-at-once, and isn't essential for some use case, it is
> just friction and I agree to forcing package names to match
> their paths. But I suspect there is _are_ use cases. It's not
> the first time we talk about this, IIRC.
It is specifically allowed. Walter felt it was important to allow
the compiler to compile source files that weren't in the expected
structure. I don't remember the use case, something like
downloading a file from the web that is expected to be in package
one.two.three.four but not actually wanting to recreate that
structure for the one file.
The only time this is required is when DMD is trying to find the
module. You can then do separate compilation by having a .di file
which does follow the correct package-path while the .d file sits
next to the other .d files (why you would do that I don't know).
More information about the Digitalmars-d
mailing list