module name inference

Peter Alexander peter.alexander.au at gmail.com
Mon Jul 15 09:55:53 PDT 2013


On Monday, 15 July 2013 at 15:45:47 UTC, Timothee Cour wrote:
> ---- src/foo/bar.d:
> // infers 'module foo.bar;' instead of 'module bar;'
> void barfun(){}
> ----
>
> ---- src/main.d:
> import foo.bar;
> void main(){}
> ----
>
> dmd -Isrc src/main.d

And what if I compile it like this?

dmd -c src/foo/bar.d
dmd -c -Isrc src/main.d
// link later

I don't think this can work in general.


More information about the Digitalmars-d mailing list