Selective and renamed imports
Christian Kamm
kamm-incasoftware at removethis.de
Tue Oct 18 10:29:06 PDT 2011
Kagamin wrote:
> afaik currently all imports include symbols into the importing module.
>
> --- a.d ---
> int z;
>
> --- b.d ---
> import a;
> a.z is available as b.z now.
No, this import does not introduce a new symbol b.z. It just adds a note to
b's root scope saying "if a symbol isn't found here, check in a".
It works differently for selective imports and that's cause for the problems
with them: If you had done 'import a : z;' there would actually be a new
symbol b.z.
More information about the Digitalmars-d
mailing list