Import improvement

Peter Alexander peter.alexander.au at gmail.com
Mon Oct 15 06:02:36 PDT 2012


On Monday, 15 October 2012 at 12:43:59 UTC, Manu wrote:
> Surely this has been considered before. Any reasons it's not 
> supported?

Yes, it has been considered before. There is an enhancement from 
ages ago in bugzilla.

http://d.puremagic.com/issues/show_bug.cgi?id=3603

The syntax you proposed doesn't work, because it conflicts with 
selective imports:

===[std.d]===
module std;
void stdio() {}

===[test.d]===
import std : stdio;

Does that import the stdio function from module std, or the 
module std.stdio?

You could use something like this:

import std.(stdio, xml, algorithm);

Of course, there's many variations (square brackets, curly 
braces, no dot, no commas...) but it's all bikeshedding.


More information about the Digitalmars-d mailing list