externally imposed conditional compilation

Gor Gyolchanyan gor.f.gyolchanyan at gmail.com
Mon Nov 26 23:53:26 PST 2012


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 at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121127/3fd524d7/attachment-0001.html>


More information about the Digitalmars-d mailing list