Effective D book?

Timon Gehr timon.gehr at gmx.ch
Sat Jun 15 14:30:49 PDT 2013


On 06/15/2013 05:09 PM, Peter Alexander wrote:
> On Saturday, 15 June 2013 at 12:20:46 UTC, Timon Gehr wrote:
>> One issue with local imports is that they hide local symbols.
>
> Can you give an example? I can't repro.
>
> void main()
> {
>      import std.stdio;
>      void writeln(string) {}
>      writeln("foo");
>      std.stdio.writeln("bar");
> }
>
> This writes only "bar".

So does this:

void main(){
     void writeln(string) {}
     writeln("foo");
     {
         import std.stdio;
         writeln("bar");
     }
}


More information about the Digitalmars-d mailing list