On 2012-11-06 17:04, Walter Bright wrote:

How about this then:

@mtype("foo", 3, "bar") int a;

And have the argument list be optional? I really like to have a short
nice
looking syntax for the simple use cases, i.e.

@mtype int b;


There's a lot more you can do with the ArgumentList syntax than
associative arrays. Furthermore, there remains the problem of how mtype
fits into the name scoping system.

As I just wrote above, how about this:

@mtype("foo", 3, "bar") int a;
@mtype int b;

In the above example, the values in the parentheses would be the same as your ArgumentList. The important thing here is also to have the ArgumentList and parentheses be optional.

What's the issue with the name scoping system? That the user defined attributes will conflict with already existing attributes? You'll have the same problem with keywords. Perhaps that's why attributes where created, to have a new namespace for keywords. Even if they might not be the same internally for the compiler it's the same for the user/developer.

Just as we have operator overloading to allow user defined types to look like built-in types we/I want the same thing for user defined attributes.

--
/Jacob Carlborg

Reply via email to