There's a tiny, but extremely useful enhancement request, that resides in bugzilla for a long time now. It proposes the possibility to have modules named "package", in which case they're imported using their package name alone:

mylib
    core.d
    aux.d
    package.d

// main.d:
    import mylib.core;
    import mylib.aux;
    import mylib;

In this case adding UDAs to packages essentially means adding UDAs to the "package" module.
And adding UDAs to any modules would look like this:

[MyUda] module mylib.core;

Since the module-level import statements affect the entire module, the later imports would be enough to make the MyUda type visible at the top.


On Tue, Nov 27, 2012 at 11:42 AM, Jacob Carlborg <doob@me.com> wrote:
On 2012-11-27 08:25, Gor Gyolchanyan wrote:
I'd go one step forward to also allow UDAs on packages. This will be
very useful for conditionally compiling entire libraries, instead of
manually setting the same UDAs for every module in the package.

How would that work? You cannot declare a package, only modules.

--
/Jacob Carlborg



--
Bye,
Gor Gyolchanyan.