Import concerns revisited

Georg Wrede georg.wrede at nospam.org
Tue Jul 11 13:28:22 PDT 2006


Walter Bright wrote:
> xs0 wrote:
> 
>>> The imports can be placed anywhere in the module, even (ugh) inside 
>>> class definitions. 'import' isn't any easier to search for than 'alias'.
>>
>> I was wondering - is there any good reason to allow imports everywhere?
> 
> 
> It's usually a good idea to make things as orthogonal, with as few 
> special case, as possible. Since imports are a declaration, they should 
> work wherever declarations work.
> 
>> OT: if you'll be changing the import system, _PLEASE_ make private 
>> imports the default.
> 
> 
> It's too late for that, sorry. 

AAARRGGGHHHHH!!!!!

I've taken it for granted this was implicitly agreed to be fixed for 
months ago.

> Also, everything else in D is public by 
> default, and consistency is sometimes better than special case rules, 
> even if those special case rules make some things easier.

Importing is conceptually distinct enough, so nobody would even notice 
this "inconsistency".

Please reconsider.

(As noted earlier, broken code, in this case, is easily fixed with a 
global replace of "import" to "public import".)



More information about the Digitalmars-d mailing list