I can't recall the exact use case which drove me to this topic at the moment. I'll definitely post it as soon as I remember. D's CTFE, mixins and templates almost make up a full language for compile-time. This allows generating the source code from within source code. The problem is that it's impossible to perform compile-time actions on a combination of modules in different compiler runs. different directly unrelated modules could contribute to the code generation process if mutable compile-time variables were available.<div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Nov 27, 2012 at 8:59 PM, David Nadlinger <span dir="ltr"><<a href="mailto:see@klickverbot.at" target="_blank">see@klickverbot.at</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 Tuesday, 27 November 2012 at 15:49:45 UTC, Gor Gyolchanyan wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Can you implement this use case?<br>
Have classes mix in something,, which will register them in a single place,<br>
which can later suppl the registered classes as a type tuple.<br>
</blockquote>
<br></div>
This is fundamentally impossible in the D module system if the "single place" S does not import the modules where the types are defined. Even if you could append strings to a "compile-time global" in S, this still wouldn't help you in any way because if you tried to mix in the string in S, you'd get nothing but a slew of undefined symbol errors.<br>
<br>
Maybe you can describe your use case a bit? I'm optimistic that there is a solution which is not radically incompatible with the design of D.<span class="HOEnZb"><font color="#888888"><br>
<br>
David<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Bye,<br>Gor Gyolchanyan.<br>
</div>