Import concerns revisited

Lars Ivar Igesund larsivar at igesund.net
Tue Jul 11 03:53:27 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. 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.

Well, who did ever say that was a good idea, everything public by
default? ;) And nothing is ever too late :)

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource & #D: larsivi



More information about the Digitalmars-d mailing list