Time to rename "D" to "@D" !?

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 25 01:09:32 PDT 2014


On 2014-06-25 01:32, Marco Nembrini wrote:

> Wouldn't an attribute like @nogc only be a keyword for attribute
> symbols, while something like nothrow is a keyword for everything?

I guess that's true.

> E.g. using @nogc means I can't define my own "nogc" UDA but I can have a
> function or variable named nogc, while I can't have a function named
> "nogc". Being a "attribute keyword" seems a much smaller restriction on
> user code.

I guess so.

> If what I wrote above is correct, why not declare existing
> compiler-attributes "attribute keywords", and then allow a mix of them:
>
>
> @(nothrow, public, const, "my_custom_attribute") void foo ();

Yeah, if the built-in attributes were implemented as UDA's, defined in 
object.d, then there would be less of a problem. Then one could always 
use fully qualified symbol names to disambiguate the attributes.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list