Proposal for an extension to the import syntax

Anders F Björklund afb at algonet.se
Mon Dec 11 04:28:47 PST 2006


Downs wrote:

> At the moment the phobos standard library packages form a very flat 
> structure.
> However, it can be anticipated that with the availability of a 1.0 spec, 
> more libraries written natively in D will arise.
> These libraries may have a far deeper and more branched package structure.
> Since D does not have a construct similar to Java's "import module.*",
> this will lead to pagefuls of import, consisting mostly of redundant
> information, and we all know redundancy is sin ^^

The usual workaround is to have an "umbrella" module of module/module.d,
so that you can import module.module; to get the usual modules imported.

See http://www.prowiki.org/wiki4d/wiki.cgi?BestPractices
#ConventionalModuleNameforImportingAllModulesinaPackage

--anders



More information about the Digitalmars-d mailing list