Importing packages

Kyle Furlong kylefurlong at gmail.com
Fri Oct 27 15:46:42 PDT 2006


Mart Roosmaa wrote:
> Hello everybody,
> 
> I am quite new to D and when learning how the packages and modules
> worked, it seemed strange to me that if one wanted to import whole
> packages one would have to create a module (for example a module called
> "All") and do public imports of every other module in the package.
> 
> While this approach works, it's quite painful to keep that module up to
> date, as people tend to forget to update the central module doing the
> public imports.
> 
> Now, I propose to extend the import declaration so that if only a
> package is given, it imports all modules in that package.
> For example "import std.c;" would import std.c.fenv, std.c.math,
> std.c.process, std.c.stdargs, etc modules.
> 
> This approach would keep the code a bit easier to maintain as one
> wouldn't have to update the public imports module all the time.
> 
> What do you think? Could it be implemented in DMD?
> 
> Thanks in advance,
> Mart Roosmaa
> 

I've wanted this since I started using D. :P



More information about the Digitalmars-d mailing list