Named multi-imports

aberba via Digitalmars-d digitalmars-d at puremagic.com
Wed Aug 16 02:54:41 PDT 2017


On Tuesday, 15 August 2017 at 21:12:24 UTC, jmh530 wrote:
> On Tuesday, 15 August 2017 at 20:33:18 UTC, Johnson wrote:
>>>
>>> Or instead of a new language feature, the gtk-d guys could 
>>> have package files ;)
>>
>> But then that only helps with one specific instance. D is full 
>> of language features, I do not see why everyone is so against 
>> them. Without them, D would be empty, nothing, and no one 
>> would use it. Adding language features should be see as 
>> something good, cause without them, we wouldn't get anywhere.
>
> In the past, I've thought it would be convenient to have 
> something like
>
> import io = std.stdio : writeln, write;
>
> and allow someone to write
>
> io.write("foo");
> io.writeln("bar");
>
> though I don't know if that causes any kinds of problems to 
> implement.

This looks really clean for code modularity.

import io = std.stdio : {writeln, write}, ...


More information about the Digitalmars-d mailing list