DIP6: Attributes

Don nospam at nospam.com
Tue Aug 4 03:12:37 PDT 2009


Kagamin wrote:
> Don Wrote:
> 
>>> To answer Don's point, there is nothing saying that the compiler can't 
>>> read attributes and change its behavior.  Of course, those would have to 
>>> be builtin attributes.
>> Yes, but then they're just keywords, with an @ in front. You'd just be 
>> kidding yourself if you think you've reduced the keyword count.
> 
> The problem with keywords is they're global. Why do you think there is module std.string, but there isn't core.stdc.wchar? It's because string is not a keyword, while wchar is. And annotations are also identifiers (though predefined, like Object) rather than keywords.

No, that's only one of the problems with keywords. Prefixing all new 
keywords with __ solves the same problem, and it's no more ugly than 
prefixing with @. But it doesn't solve the other keyword problems.



More information about the Digitalmars-d mailing list