DIP61: Add namespaces to D

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Sat Apr 26 11:30:28 PDT 2014


On Saturday, 26 April 2014 at 18:18:39 UTC, Walter Bright wrote:
> On 4/26/2014 7:38 AM, Daniel Murphy wrote:
>> So, people didn't like the proposal last time you made the 
>> thread, so you made
>> it again?  My objections from the last thread still stand.  
>> Mangling is all we
>> need, just add a pragma or attribute to add mangling and don't 
>> tie it to other
>> language elements.
>
> 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.

Ideally - use usual D tools of disambugation. Modules, static 
structs etc.

Compromise - consider namespace definition from extern(C++) 
during name resolution. But still keep actual feature tied to 
"extern(C++)" to keep its use case clear.


More information about the Digitalmars-d mailing list