DIP61: Add namespaces to D

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Sat Apr 26 17:08:47 PDT 2014


On 04/27/2014 01:59 AM, Andrei Alexandrescu wrote:
> On 4/26/14, 4:32 PM, Walter Bright wrote:
>> Since the namespace keyword doesn't seem to be gaining much traction, an
>> alternative syntax would be:
>>
>>      extern (C++, N.M) { void foo(); }
>>
>> which would be semantically equivalent to the previous:
>>
>>      extern (C++) namespace N { namespace M { void foo(); }}
>
> Noice. Would the user call it with N.M.foo() or just foo()? -- Andrei

foo(), N.foo() or N.M.foo(). (Name clashes may increase the required 
granularity.)


More information about the Digitalmars-d mailing list