externally imposed conditional compilation

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


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


More information about the Digitalmars-d mailing list