[Issue 2698] Parameterised identifier

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 4 06:07:44 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2698





------- Comment #1 from clugdbug at yahoo.com.au  2009-03-04 08:07 -------
You missed a third use-case: giving identifiers the names of keywords. This may
be significant when interfacing with other languages. (Or even, earlier
versions of D!).

extern(C) {
int __identifier("pure")(int);
}

__identifier is a keyword in MSVC for this reason.


(BTW, if you _were_ going to support the name mangling case, a better syntax
would probably be:
__identifier("name", "mangle")
One situation where this would be useful would be in direct linking to C++
compilers other than DMC/GCC. But I don't think that should be considered at
all in this proposal).


-- 



More information about the Digitalmars-d-bugs mailing list