<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2014/1/6 Andrei Alexandrescu <span dir="ltr"><<a href="mailto:SeeWebsiteForEmail@erdani.org" target="_blank">SeeWebsiteForEmail@erdani.org</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 1/5/14 8:44 PM, Kenji Hara wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Honestly, "lazy import" (== defer loading module file and running<br>
semantic analysis for symbol search) would improve compilation speed for<br>
selective imports and static imports, but it would have no merit for<br>
basic imports.<br>
<br></div>
So precisely, "all imports lazy would be a net large win." is not correct.<br>
</blockquote>
<br>
Consider:<br>
<br>
import std.stdio;<br>
void main() { writeln("Hello, world!"); }<br>
<br>
Currently std.stdio and all modules transitively imported by it would be opened.<br>
<br>
With lazy imports, std.stdio gets opened and then writeln() gets semantically analyzed. Only modules required by writeln() itself will actually be opened. Big difference.</blockquote><div><br></div><div>Thanks for explanation. Indeed it would be big difference. </div>
<div><br></div><div>Kenji Hara</div></div></div></div>