Import concerns revisited

Bruno Medeiros brunodomedeirosATgmail at SPAM.com
Tue Jul 11 12:56:02 PDT 2006


xs0 wrote:
> Tom S wrote:
> 
>> Another downside is that, the selective import using the 'with' 
>> construct only imports these symbols into the current scope, while 
>> 'static import' allows you to access all symbols from the imported 
>> module if you use a fully qualified name. This is as evil as the 
>> "'private', yet not private" symbols in modules.
> 
> While I support improving import (particularly allowing import of single 
> symbols), I think you're exaggerating here. There is actually nothing 
> wrong if all FQNs from a module are accessible (if private worked, 
> anyway ;), as most all of the problems arise only with unqualified 
> names.. In fact, some languages (e.g. Java) allow access via FQN without 
> even specifically importing anything, and I never heard referred to that 
> feature as evil before :)
> 
> That private symbols are visible is pure evil, though :) They should 
> behave as if they don't exist to outside their module, that being the 
> whole point of tagging something as private.
> 
> 
> xs0

I must strongly reinforce this statement. There is nothing wrong with 
FQNs being automatically available in a program (it's how Java and C# 
work), in fact, I strongly prefer this behavior and am planning to 
implement it in D when we get the FQN import. 
(news://news.digitalmars.com:119/e8r8tt$10cf$3@digitaldaemon.com)

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



More information about the Digitalmars-d mailing list