Custom attributes (again)

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Apr 6 08:00:25 PDT 2012


On 4/6/12 5:06 AM, Walter Bright wrote:
> On 4/6/2012 2:41 AM, Johannes Pfau wrote:
>> The last time custom attributes where discussed, a C# like model was
>> proposed. Is there a good reason why we should deviate from the C#
>> implementation?
>
> C# uses a runtime implementation, not a compile time one.

Speaking of the distinction, it would be great if we arranged things 
such that attributes are a lowering to existing D (i.e. the compiler 
rewrites a nice attribute syntax into clunky D code you wouldn't want to 
write by hand).

Lowerings have worked miracles for us in terms of keeping language 
semantics simple and reducing implementation bugs. We should use them 
wherever appropriate.


Andrei


More information about the Digitalmars-d mailing list