DIP61: Add namespaces to D

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Mon Apr 28 09:36:24 PDT 2014


On 4/28/14, 1:15 AM, Daniel Murphy wrote:
> "Walter Bright"  wrote in message news:ljjmi6$16nk$1 at digitalmars.com...
>
>> Ok, I saw that, and replied to it earlier this thread.
>
> Yes, but you seemed to miss the point.
>
>> Having a pragma to just add mangling doesn't deal with problems like:
>>
>>      namespace N { int foo(); }
>>      namespace M { int foo(); }
>>
>>      foo();  // how to specify which one gets called?
>>
>> I.e. only addressing name mangling does not scale. Need actual scopes,
>> too.
>
> We have MODULES to deal with conflicts.  We do NOT need to add a new
> type of scope to D just for C++ namespaces.
>
> You deal with conflicts the SAME WAY you do with normal symbols - put
> them in different modules.
>
> This is more powerful, because it doesn't force you to match the
> namespace layout in your D code.

I've missed that proposal, and couldn't find browsing through your 
recent posts. Could you please send a link, thanks. -- Andrei


More information about the Digitalmars-d mailing list