Custom attributes (again)

deadalnix deadalnix at gmail.com
Fri Apr 6 08:05:16 PDT 2012


Le 06/04/2012 17:00, Andrei Alexandrescu a écrit :
> 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

Again, I rise the need of AOP.

No need for runtime attribute or compiler magic if we have AOP that 
could interleave « clunky D code you wouldn't want to write by hand » 
without adding yet again another language feature.


More information about the Digitalmars-d mailing list