User Defined Attributes

Jakob Ovrum jakobovrum at gmail.com
Tue Nov 6 03:11:38 PST 2012


On Tuesday, 6 November 2012 at 09:24:58 UTC, Jens Mueller wrote:
> which admittedly has less syntactical appeal (and probably other
> problems) but can maybe improved. But to which point.
> What do you gain by adding it to the core language?
>
> Jens

In the initial discussions, I was hoping that the symbol itself 
would be made available in some fashion. For example, enabling 
something like this:

template Test(alias sym)
{
     pragma(msg, "test attribute was attached to:");
     pragma(msg, sym);
     enum Test = true;
}

[Test] int a;

However, I can imagine that it's always possible to work around 
this by doing the actual work later when both the symbol and 
attribute are available.



More information about the Digitalmars-d-announce mailing list