Import conflict resoultion
Bruno Medeiros
brunodomedeirosATgmail at SPAM.com
Thu Jul 13 08:16:40 PDT 2006
Andrei Khropov wrote:
> Regan Heath wrote:
>
> <skipped>
>
> Good survey, thanks.
>
> My vote is for #3 as well as #4 to be available (exact syntax may vary).
>
> ("import std.string std.string" is disgusting :-) )
>
Yep, I was about to say the same. #3 (FQN import) should be there,
regardless of whether #4 (aliasing import, aka prefix import) is or is
not as well.
As for #4, (basically the same as kris's RFC), I'm not sure yet, but I
guess it would be alright. Altough there is something I think I'm not
very found of: the ability for one to change the module and/or package
name, like this:
import foo.string as str;
Instead we could have a syntax that would not allow it (and which would
also be shorter, but require a keyword other than import):
xptoimport foo.string; // makes the name "string" available
This is actually basically the same as the selective import, only that
it also allows modules and packages themselves to be selectively
imported (which is why it requires a new keyword). (For clarity, it can
be called universal selective import)
--
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
More information about the Digitalmars-d
mailing list