On Fri, 16 Mar 2012 09:35:54 -0400, Adam D. Ruppe <destructiona...@gmail.com> wrote:

On the ride over here today, I had a thought that
I think neatly solves the user defined attribute
question.

enum Serializable { yes, no }

@note(Serializable.yes) int a;

I thought @<symbol> was supposed to be a user-defined annotation. Otherwise, why did we introduce @syntax?

I'd rather see something like this:

@annotation serializable(bool x = true) {return x ? Serializable.yes : Serializable.no;} // implicit auto

@serializable int a;
@serializable(false) int b;

Where annotations have to be CTFE-able (because they are constructed at compile-time)

-Steve

Reply via email to