Partially qualified module name lookup

Andrej Mitrovic andrej.mitrovich at gmail.com
Tue Feb 15 16:17:28 PST 2011


If modules B and C belong to the A package, then there are no "B" and
"C" modules, there are "A.B" and "A.C" modules. You can refer to a foo
function by either:
foo()
or
A.b.foo()

Of course, in this case the two functions will conflict if you don't
fully qualify the names. A workaround is to use named imports:

import B = A.B;
import C = A.C;

void main()
{
    B.foo();
    C.foo();
}


More information about the Digitalmars-d mailing list