import concerns (was Re: Historical language survey)

Walter Bright newshound at digitalmars.com
Sat Jul 8 17:54:03 PDT 2006


Kris wrote:
> Er, that really doesn't work at all. Please ignore what I said a few minutes ago
> regarding this option (I really should get some sleep instead). 
> 
> The problem here is that, for the proposed static imports, everything must be
> fully-qualified with the /original import name/, and that's just plain awful for
> long import names. The "import as" allows one to give it a nice short name
> instead.

Alias also works fine for making substitutes for long, awkward names:

import x.y.mod;
alias x.y.mod t;

x.y.mod.foo();	// works
t.foo();	// also works


> And, I still think the selective-import is the superior solution anyway.

Semantically, it isn't any different. It would even be implemented 
internally using the 'alias' machinery.



More information about the Digitalmars-d mailing list