<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2015-06-10 15:55 GMT+09:00 Walter Bright via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On 6/9/2015 10:39 PM, deadalnix wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
The actual code is far more complex than the presented sample :)<br>
<br>
That what I'm trying to do in general, but here I'm faced with cases that are<br>
very hard to untangle.<br>
</blockquote>
<br></span>
The 'tangle' of cyclical import graphs, as you so appropriately put, is not only hard on the compiler, it makes it much harder for human readers to make sense of code. Even reading your little code snippet hurts my brain.<br>
<br>
Go, in one of their better decisions, decided "Thou Shalt Not Have Import Cycles". This forces users to untangle their code, and I believe that is A Good Thing.<br>
<br>
I'd like to do that for D, but of course it is far too late for that.<br>
</blockquote></div><br></div><div class="gmail_extra">D has true forward reference resolution mechanism. In that case modules are cyclic imported, but the declared symbols don't have actual cyclic references. Therefore the snippet should work.<br><div><br></div><div><a href="https://github.com/D-Programming-Language/dmd/pull/4735">https://github.com/D-Programming-Language/dmd/pull/4735</a><br></div><div><br></div><div>And the regression was introduced by your unrelated change. While fixing the issue, I couldn't understand why it was necessary.</div><div><br></div><div><a href="https://github.com/D-Programming-Language/dmd/commit/a04cf864b932061ad7b72e7cad8b16fabc6a825a">https://github.com/D-Programming-Language/dmd/commit/a04cf864b932061ad7b72e7cad8b16fabc6a825a</a><br></div><div><br></div><div>Kenji Hara</div></div></div>