User Defined Attributes

Jacob Carlborg doob at me.com
Tue Nov 6 05:04:02 PST 2012


On 2012-11-06 09:20, Sönke Ludwig wrote:
> Wow, that's a surprise! Just yesterday I was thinking that it would be
> really nice to have them for a piece of code ;)
>
> But shouldn't we keep the syntax closer to normal attributes and other
> languages(*)? I see a lot of arguments for doing that, with the only
> counter-argument that they would be in the same namespace as the
> built-in attributes (which should not be that bad, as this is very low
> level language stuff).
>
> (*) i.e. @mytype or @("string") and without the '[]'

I agree, I a syntax like this would have been nicer:

@mtype("key" : "value") int a; or @mtype(key : "value") int a;
@mtype("value") int b;
@mtype int c;

-- 
/Jacob Carlborg


More information about the Digitalmars-d-announce mailing list