Module and package with the same name

Unknown W. Brackets unknown at simplemachines.org
Thu Mar 23 21:41:20 PST 2006


Walter,

I think he means that this:

import foo;

And this:

import foo.bar;

Could work, if modules and packages were "the same thing."  So, 
"foo.func" would be a function in foo, and "foo.bar.func" would be a 
function in foo.bar.  Since, already, foo.bar doesn't necessarily mean 
anything semantic anyway.

At least, that's what I read.

-[Unknown]


> "Bruno Medeiros" <daiphoenixNO at SPAMlycos.com> wrote in message 
> news:dvujbc$1j5e$1 at digitaldaemon.com...
>> 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.
> 
> You can do that now:
> 
> ---------------
> module foo;
> 
> import bar;
> import abc;
> ----------------- 
> 
> 



More information about the Digitalmars-d mailing list