<div class="gmail_extra">On 28 November 2012 17:47, Max Samukha <span dir="ltr"><<a href="mailto:maxsamukha@gmail.com" target="_blank">maxsamukha@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><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 16:19:59 UTC, Manu wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
On 27 November 2012 17:49, Gor Gyolchanyan <<a href="mailto:gor.f.gyolchanyan@gmail.com" target="_blank">gor.f.gyolchanyan@gmail.com</a>><u></u>wrote:<br>
<br>
</div><div class="im"><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<br>
place, which can later suppl the registered classes as a type tuple.<br>
<br>
</blockquote>
<br></div><div class="im">
I don't do it as a type tuple, why do you need that?<br>
I do it as a runtime registry.<br>
<br>
I have 'mixin RegisterModule;' at the top of every module.<br>
</div></blockquote>
<br>
And at this point we are back to the famous problem with static constructors in circularly imported modules:<br>
<br>
module a;<br>
import b;<br>
mixin RegisterModule;<br>
<br>
<br>
module b;<br>
import a;<br>
mixin RegisterModule;<br>
</blockquote></div><br></div><div class="gmail_extra">Certainly a potential problem, but I've set up my code such that these static constructors themselves have no external dependencies, and initialisation order is unimportant, since registered stuff just ends up in a globally accessible hash table anyway.</div>
<div class="gmail_extra">Not a problem for me, but I have encountered this problem in other situations, and also prototype configurations ;)</div>