Beta 2.079.0

jmh530 john.michael.hall at gmail.com
Tue Feb 20 20:08:55 UTC 2018


On Tuesday, 20 February 2018 at 19:36:46 UTC, John Gabriele wrote:
>
> In:
>
>     import myModule : foo, bar;
>
> how do you know if bar is myModule.bar or if it's a separate 
> module bar?

It probably could be described a little better in the change log. 
It uses examples, but doesn't really describe what the file 
structure is that work with those examples.

Perhaps this:

--- pkg.d
module pkg;

public import pkg.mod1;
public import pkg.mod2;

--- pkg.mod1.d
module pkg.mod1;

enum sym1;

--- pkg.mod2.d
module pkg.mod2;

enum sym2;

If this structure works for both of those examples, then
import pkg.mod1 : sym1, mod2 : sym2;
works because mod2 has a selective import and
import pkg.mod1 : sym1, sym2, pkg.mod2;
works because pkg.mod2 is fully qualified (it may be annoying to 
find sym2 if this works with the above structure).

So in your example you know that bar is in myModule because bar 
is neither fully qualified, nor is it fully qualified.

So it seems like something below would also work
import pkg : mod1 : sym1, mod2 : sym2;
but then what about
import pkg.mod1 : sym1, mod2 : sym2, sym3;
Is sym3 part of mod1 or mod2?


More information about the Digitalmars-d-announce mailing list