D import idiom compilation time

Neia Neutuladh neia at ikeran.org
Sat Jan 5 17:30:15 UTC 2019


On Sat, 05 Jan 2019 06:52:14 -0800, H. S. Teoh wrote:
> Hmm. Couldn't you make it work by making it lazy? I.e., have opDispatch
> return a struct that encapsulates a partial package path, and that
> contains a further opDispatch to resolve the next component in the
> qualified name, and that only resolves to the actual symbol when it
> actually references an actual symbol?

Right! However, you can't tell the difference between accessing a symbol 
that doesn't exist and accessing a package.

You'll see a difference in things like:

    static if (is(typeof(from.std.socket.Sockte)))

In this lazy model, that's going to be a FromImpl!"std.socket.Sockte" and 
will pass. In the eager model, it would be std.socket.Sockte, which 
doesn't exist.


More information about the Digitalmars-d mailing list