Modules vs Packages
Julio César Carrascal Urquijo
jcarrascal at gmail.com
Sat Sep 8 18:17:32 PDT 2007
Jarrett Billingsley wrote:
> "Giuseppe Bilotta" <giuseppe.bilotta at gmail.com> wrote in message
> news:fbtpp1$2k8t$1 at digitalmars.com...
>
>> I see no reason why we couldn't have
>>
>> package.d
>> package/module1.d
>> package/module2.d
>>
>
> This has been brought up so many times.. I think Walter needs to put an
> explanation of this on the modules page.
>
> I don't see the reason for it either.
I think it was disallowed because package.d could contain some symbol
with the same name as another module in the package. For example:
// package.d
struct a {};
// package/a.d
...
// main.d
import package.a;
In this case it might be unclear whether the import refers to the struct
in package.d or the module package.a.
On the other hand, Kirk McDonald's suggestion to add a "this.d" module
is very interesting. This should probably discussed further.
More information about the Digitalmars-d
mailing list