Module and package with the same name

Bruno Medeiros daiphoenixNO at SPAMlycos.com
Thu Mar 23 08:49:15 PST 2006


Walter Bright wrote:
> "Francois Retief" <fgretief at ieee.org> wrote in message 
> news:dvn6t3$uh9$1 at digitaldaemon.com...
>> #  hal.d: module hal and package hal have the same name.
>>
>> Is this expected behaviour?
> 
> Yes.
> 
>> If so, why this limitation?
> 
> For the same reason that this doesn't work:
> 
> int S;
> struct S { ... }
> 
> Name resolution should be scope dependent, not semantic dependent.
> 
> 
Indeed it should. However if the module were to also be the package, 
(i.e., a module could contain other modules, like C++'s or C#'s 
namespaces) then we could have that behavior and the name resolution 
still be scope dependent.

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



More information about the Digitalmars-d mailing list