Named multi-imports

rjframe via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 17 04:40:11 PDT 2017


On Wed, 16 Aug 2017 12:04:13 +0000, jmh530 wrote:
> 
> Well I knew that renamed imports were allowed, but I didn't realize you
> could do re-named selective imports (the " : writeln,
> write" part of it). I just double-checked and it worked. I don't recall
> it working in the past.
> 
> I see that there's an example in the spec, but it is a little more
> complicated than my example.

It doesn't quite work; it provides access to all names in the module, and 
write/writeln is introduced into the global namespace; e.g., it's 
interpreted as
`import io = std.stdio; import std.stdio : write, writeln;`

https://issues.dlang.org/show_bug.cgi?id=17756


More information about the Digitalmars-d mailing list