Why the @ in @safe? & UDAs

Shammah Chancellor S at S.com
Wed Nov 6 16:13:49 PST 2013


My understanding is that @ attributes were for used-defined behavior 
only.   Pure and nothrow, since the compiler implements behavior on 
those keywords, do not have the @ sign.   So, why is @safe, @safe, and 
not just "safe".

On the basis that @attributes should not have compiler defined 
behavior.   Please take off the @ from the @safe.   This would apply to 
@trusted as well.

Also,  I think that having UDAs (user defined attributes) be freeform, 
and not a class following some interface is asking for trouble.  It 
makes them hard to use reflection with, and it also causes the 
potential for modules to use the same literal for different purposes.  
I think C# has this right.



More information about the Digitalmars-d mailing list