DIP6: Attributes

Ellery Newcomer ellery-newcomer at utulsa.edu
Sat Aug 1 15:51:52 PDT 2009


Robert Fraser wrote:
> Ary Borenszweig wrote:
>> http://www.prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP6
> 
> I think annotations are a good idea, but turning keywords already in the
> language into annotations seems kinda pointless & would kill backwards
> compatibility. In C#/Java some things are modifiers while others are
> annotations -- and with good reason.
> 
> IMO, the focus of annotations should be mostly on things _external_ to
> the compiler. So, serializability, thread safety, etc. Really, I think
> annotations should be for compile-time reflection (so like someone else
> said __traits(annotations, symbol) should return a tuple of annotation
> structs.

Seconded. Annotations sound like a useful feature especially if they can
be created and manipulated by the programmer, which would require
syntactic distinction. I never did much care for java's annotation
syntax, but I do think turning most if not all of the keywords mentioned
into annotations is a good idea, at least behind the scenes.

Off the top of my head, it could solve the function <-> delegate ref
parameter problem.



More information about the Digitalmars-d mailing list