DIP61: Add namespaces to D

Daniel Murphy via Digitalmars-d digitalmars-d at puremagic.com
Mon Apr 28 22:04:03 PDT 2014


"Andrei Alexandrescu"  wrote in message news:ljm83i$d6i$1 at digitalmars.com...

> Thanks. Isn't it unprecedented for pragmas to introduce scopes and to be 
> un-ignorable? -- Andrei

(I'll assume you mean introduce scopes as in the {} syntax, not the way 
Walter's proposal introduces scopes)

No, pragma(mangle) works in a very similar way, so there is a precedent.  It 
also serves a very similar purpose and can actually accomplish the same 
things, cpp_mangle would just be a more specialized tool.

Pragmas can be used with all three attribute syntaxes:

Single declaration:
pragma(blah)
int x;

Block:
pragma(blah)
{
    int x;
}

Label:
pragma(blah):
int x; 



More information about the Digitalmars-d mailing list