Effective D book?

Walter Bright newshound2 at digitalmars.com
Sun Jun 16 09:48:46 PDT 2013


On 6/16/2013 2:06 AM, Peter Alexander wrote:
> On Saturday, 15 June 2013 at 23:36:35 UTC, Walter Bright wrote:
>> On 6/15/2013 2:34 PM, Timon Gehr wrote:
>>> It sure is, the module system is supposed to provide hijacking protection.
>>
>> Inner scopes override outer scopes. That isn't what hijacking is.
>
> I think this is an issue Walter, consider:
>
> void main()
> {
>      import std.stdio;
>      string message = "Hello, world!";
>      writeln(message);
> }
>
> It std.stdio contains a symbol called "message" then this will not print "Hello,
> world".

Yes, it will. Current scope overrides imported scope.



More information about the Digitalmars-d mailing list