filtered imports

Vladimir Panteleev thecybershadow.lists at gmail.com
Thu Sep 13 17:54:03 UTC 2018


On Thursday, 13 September 2018 at 16:23:21 UTC, Jonathan Marler 
wrote:
> The immediate example is to resolve symbol conflicts.

I've ran into this a few times:

import std.stdio;
import std.file;

void main(string[] args)
{
	auto text = readText(args[1]);
	write("The contents of the file is: ", text);
}

However, it is solved with an alias:

alias write = std.stdio.write;

(or using selective imports or fully-qualified identifiers for 
either module of course).



More information about the Digitalmars-d mailing list