Proposal: user defined attributes
Tove
tove at fransson.se
Sun Mar 18 03:38:18 PDT 2012
On Sunday, 18 March 2012 at 10:25:20 UTC, F i L wrote:
> F i L wrote:
> class CoolClass
> {
> mixin Attribute!("int", "a", "Cool", "Heh");
> mixin Attribute!("int", "b", "Cool", "Sup");
> }
>
> void main()
> {
> auto c = new CoolClass();
> writeln(c.a, ", ", c.b); // 0, 0
> writeln(c.a_Cool().s); // Heh
> writeln(c.b_Cool().s); // Sup
> }
Is it not possible to alias a mixin to just one letter, and then
use it to have any syntax we want... something like this:
x("@attribute(Serializable.yes) int a");
More information about the Digitalmars-d
mailing list