Import concerns revisited

Bruno Medeiros brunodomedeirosATgmail at SPAM.com
Tue Jul 11 09:25:25 PDT 2006


Walter Bright wrote:
>> I think you are missing the point. *sigh*. Read above. 
>> Imports/namespaces make
>> up what constitutes a D program.  I think it's a very central, 
>> critical, and
>> special to D.
> 
> I certainly agree with that. What I am unconvinced of, however, is that 
> the *renaming* is central or critical. Note that C, C++, Java, C#, Ruby, 
> etc., do not support renaming. Only Python seems to. And only D has a 
> general purpose renaming capability.

Correction: C# does support renaming, they have using-alias-directive 
statement which functionality-wise is pretty much like D's alias:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csspec/html/vclrfcsharpspec_9_3_1.asp
This alias directive supports the aliasing of namespaces and namespace 
members.

But I agree that renaming doesn't seem central or critical to a D 
program. At least not in a way that we would need an "import ... as ..." 
other than just D's "alias".

Sidenote: C#'s using-namespace and using-alias do not create new members 
in where they are imported, they are not transitive. In other words, 
they are like "private import". (As everyone says D's import should be 
by default...)

-- 
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list