How to avoid multiple spelling `import`

Idan Arye via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jun 16 04:16:29 PDT 2015


On Tuesday, 16 June 2015 at 09:33:22 UTC, Dennis Ritchie wrote:
> Hi,
>
> I can write this:
>
> import std.range : chain, split;
>
> But I can not write this:
>
> import std.range : chain, split, std.algorithm : map, each;
>
> We have several times to write the word `import`:
>
> import std.range : chain, split;
> import std.algorithm : map, each;
>
> Does D something to solve this problem? Maybe there is 
> something like:
>
> import std.range{chain, split}, std.algorithm{map, each};
>
> import std.range(chain, split), std.algorithm(map, each);
>
> import {
>     std.range : chain, split;
>     std.algorithm : map, each;
> }

There is no problem to be solved here. Having to type `import` 
for each imported module is not big enough a burden to justify 
this additional syntax.


More information about the Digitalmars-d-learn mailing list