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.<div class="gmail_extra">
<br><br><div class="gmail_quote">On Sun, Nov 25, 2012 at 3:56 PM, 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-23 12:38, Gor Gyolchanyan wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2. I can't use static if because:<br>
     2.1. I can't define FOOBAR from outside of the package this code<br>
will be in.<br>
     2.2. I can't include the definition of FOOBAR into the package<br>
(like config.d) and expect it to be changed as necessary, because the<br>
package encapsulation will be broken.<br>
</blockquote>
<br></div>
What about using version identifiers to set constants and the use static-if? Something like this:<br>
<br>
<a href="https://github.com/jacob-carlborg/dvm/blob/d1/dvm/util/Version.d" target="_blank">https://github.com/jacob-<u></u>carlborg/dvm/blob/d1/dvm/util/<u></u>Version.d</a><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>