2014/1/6 Andrei Alexandrescu <SeeWebsiteForEmail@erdani.org>
On 1/5/14 5:22 PM, Martin Nowak wrote:
On 12/20/2013 09:43 PM, Martin Nowak wrote:

Couldn't static imports be made lazy without breaking any code?
The above example would read.

static import std.range.

void foo(R)(R range) if (std.range.isForwardRange!R)
{
}

Furthermore selective import can always be made lazily without changing
code.

import std.algorithm : min;

Only if `min` or `std.algorithm` are used the compiler needs to open
std.algorithm.

I thought more about this and I think that's wrong. Making all imports lazy would be a net large win.

Honestly, "lazy import" (== defer loading module file and running semantic analysis for symbol search) would improve compilation speed for selective imports and static imports, but it would have no merit for basic imports.

So precisely, "all imports lazy would be a net large win." is not correct.

Kenji Hara