Nested public imports - bug or feature?

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 13 09:36:58 PDT 2015


On Thursday, 13 August 2015 at 16:22:04 UTC, Dicebot wrote:
> On Thursday, 13 August 2015 at 16:19:29 UTC, Jonathan M Davis 
> wrote:
>> You can get that behavior with static imports in D, but having 
>> to use the whole import path while referencing symbols gets 
>> ugly fast.
>
> Check example again, you are only required to use the plain 
> module name, not fully qualified one. With D syntax:
>
> import std.stdio;
>
> writeln(); // not good
> stdio.writeln(); // good
> std.stdio.writeln(); // also good, but not required

Well, that's better than requiring the full import path, but 
requiring _any_ module name is just plain annoying IMHO. If I 
were okay with that I wouldn't be doing stuff like

using namespace std;

in all of my .cpp files - and that's a really common thing to do.

- Jonathan M Davis


More information about the Digitalmars-d mailing list