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:<div>
<br></div><div>mylib</div><div>    core.d</div><div>    aux.d</div><div>    package.d</div><div><br></div><div>// main.d:</div><div>    import mylib.core;</div><div>    import mylib.aux;</div><div>    import mylib;</div><div>
<br></div><div>In this case adding UDAs to packages essentially means adding UDAs to the "package" module.</div><div>And adding UDAs to any modules would look like this:</div><div><br></div><div>[MyUda] module mylib.core;</div>
<div><br></div><div>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.</div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Nov 27, 2012 at 11:42 AM, Jacob Carlborg <span dir="ltr"><<a href="mailto:doob@me.com" target="_blank">doob@me.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 2012-11-27 08:25, Gor Gyolchanyan wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'd go one step forward to also allow UDAs on packages. This will be<br>
very useful for conditionally compiling entire libraries, instead of<br>
manually setting the same UDAs for every module in the package.<br>
</blockquote>
<br></div>
How would that work? You cannot declare a package, only modules.<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
/Jacob Carlborg<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Bye,<br>Gor Gyolchanyan.<br>
</div>