Flat module import namespace causing collisions

Martin Nowak dawg at dawgfoto.de
Thu Feb 16 08:37:14 PST 2012


On Thu, 16 Feb 2012 14:56:30 +0100, Artur Skawina <art.08.09 at gmail.com>  
wrote:

> On 02/16/12 14:25, James Miller wrote:
>> I'm not sure if I'm reading this right... You aren't very clear...
>>
>> I think its just because putting a single `module` statement in a file
>> is good practice. Its a single line and makes you think about your
>> layout and structure.
>>
>> Also, there is no global namespace in D, so it must create a module
>> level namespace for your file if you don't specify one. No matter what
>
> The problem is that instead of using the fully qualified name, which is
> guaranteed not to conflict with anything else, "it" chooses a simplified
> one - just the basename.
> Having to put a "module" statement in every module shouldn't be necessary
> - flattening the namespace only saves you a few keystrokes in the rare
> case when you need to explicitly access that module (because of  
> conflicting
> symbols).
>
> artur

You cannot access that module through the shortened name only through the  
import name.
The (implicit) module declaration affects only package membership and  
mangling.


More information about the Digitalmars-d mailing list