externally imposed conditional compilation

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


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.


On Tue, Nov 27, 2012 at 11:22 AM, Gor Gyolchanyan <
gor.f.gyolchanyan at gmail.com> wrote:

> Nice idea, especially with the template to make things easier. Still it
> looks ugly. Version identifiers and numbers (as well as debug identifiers
> and numbers) serve a very good purpose (parametrizing modules), but they're
> vastly incomplete. There's so much useful stuff that could be done if
> module could have access to data of user defined types. I think this is
> very close to the idea of UDAs. If UDAs become mutable (which I think would
> be the most important feature of UDAs), then the module declaration could
> also get mutable UDAs, which would solve all problems. Don't you think? And
> version identifiers can be used as described in Version.d, except they'll
> change the module UDAs instead of defining a manifest constant.
>
>
> On Sun, Nov 25, 2012 at 3:56 PM, Jacob Carlborg <doob at me.com> wrote:
>
>> On 2012-11-23 12:38, Gor Gyolchanyan wrote:
>>
>>  2. I can't use static if because:
>>>      2.1. I can't define FOOBAR from outside of the package this code
>>> will be in.
>>>      2.2. I can't include the definition of FOOBAR into the package
>>> (like config.d) and expect it to be changed as necessary, because the
>>> package encapsulation will be broken.
>>>
>>
>> What about using version identifiers to set constants and the use
>> static-if? Something like this:
>>
>> https://github.com/jacob-**carlborg/dvm/blob/d1/dvm/util/**Version.d<https://github.com/jacob-carlborg/dvm/blob/d1/dvm/util/Version.d>
>>
>> --
>> /Jacob Carlborg
>>
>
>
>
> --
> Bye,
> Gor Gyolchanyan.
>



-- 
Bye,
Gor Gyolchanyan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121127/8da14912/attachment-0001.html>


More information about the Digitalmars-d mailing list