User Defined Attributes

Jakob Ovrum jakobovrum at gmail.com
Tue Nov 6 00:39:46 PST 2012


On Tuesday, 6 November 2012 at 07:55:51 UTC, Walter Bright wrote:
> -snip-

It doesn't look like it would be possible to schedule any runtime 
code using this, meaning they're not usable for stuff like 
registering types for serialization support, or doing runtime 
linking when attached to a function pointer, etc.

Even with user defined types or functions used in the attribute, 
the type or function itself doesn't know anything about the 
symbol it is being attached to, so it's quite limited what it can 
do.

Compared to other prevalent UDA systems, like C#'s, I'd say that 
this one is extremely limiting due to the two above points.

I'd love to hear some examples of what this particular take on 
UDAs allows in D, though.



More information about the Digitalmars-d-announce mailing list