Name lookups in D

aberba karabutaworld at gmail.com
Fri Dec 11 12:19:00 UTC 2020


On Friday, 11 December 2020 at 01:34:13 UTC, kdevel wrote:
> On Monday, 16 November 2020 at 13:07:21 UTC, Steven 
> Schveighoffer wrote:
>> import std.stdio;
>>
>> std.stdio.writeln("bar"); // OK
>
> Is this expected?
>
> void main ()
> {
>    {
>       import std.stdio;
>       std.stdio.writeln ("test"); // okay
>    }
>    {
>       import std.stdio : writeln;
>       std.stdio.writeln ("test"); // Error: undefined 
> identifier std
>    }
> }

This behaviour makes sense to me...you've explicitly exposed only 
that symbol.


More information about the Digitalmars-d mailing list