DIP6: Attributes

Ary Borenszweig ary at esperanto.org.ar
Mon Aug 3 05:16:09 PDT 2009


Lars T. Kyllingstad escribió:
> Ary Borenszweig wrote:
>> http://www.prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP6
> 
> 
> I like the idea of attributes having names that can never be 
> identifiers, since adding new attributes will then, as you point out, 
> never break existing code.
> 
> But won't we lose this benefit if we later allow user-defined annotations?

Kind of, but not totally. If you allow user-defined annotations, they 
need to be placed in a module, so they have a fully qualified name. You 
could have an foo.bar.align annotation (supposing "align" was already an 
annotation) and do:

@foo.bar.align
int x;

The compiler-instrinsic annotations would be defined in module object or 
something like that.

That way you can disambiguate annotations with same names.



More information about the Digitalmars-d mailing list