Is package.d a good idea?

Adam D. Ruppe destructionator at gmail.com
Wed Jul 4 14:59:23 UTC 2018


On Wednesday, 4 July 2018 at 14:54:41 UTC, Steven Schveighoffer 
wrote:
> How would this affect the package attribute?

Nothing should change, since packages are determined from the D 
module declaration, not the filename or directory layout.

This is even true with package.d itself, but it is a weird 
exception because for some inexplicable reason, the compiler ALSO 
requires a certain filename to accept the declaration (whereas it 
doesn't care for any other module).

If you were to have a dir layout

foo.d
whatever/bar.d

and foo.d was

module ok.awesome.works.for.me;

and whatever/bar.d was

module ok.awesome.works.for.someone;



they are both part of the `ok.awesome.works.for` package, 
regardless of their filenames.


More information about the Digitalmars-d mailing list