Modules vs Packages

Jarrett Billingsley kb3ctd2 at yahoo.com
Sat Sep 8 07:43:23 PDT 2007


"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 other people have explained 
it as something along the lines of "packages aren't the same as modules, so 
you can't have one name map to two things".  I don't buy that.  I don't see 
how packages are any different from modules.  They're both just namespaces. 
That's how they work in my scripting language: packages == modules, and you 
can have packages and modules with the same name.

Until (if) this changes, the most common way to do what you want to do in D 
is to have a "relcomp.all" module which imports everything else. 





More information about the Digitalmars-d mailing list