All function attributes possible with "@"?
01010100b via Digitalmars-d
digitalmars-d at puremagic.com
Tue Dec 13 14:40:47 PST 2016
On the wiki there is an argument given for why not to allow "@"
on function attributes which are keywords, however it seems to
include a reasoning error.
This is the argument:
"Why don't we just allow an '@' character on all function
attributes so it looks consistent?
To appreciate the answer for this remember that the original
problem is a matter of consistency. It's inconsistent that some
function attributes use an '@' character and some don't. If D
supported putting an '@' character on the function attributes
that are also keywords, then this moves the inconsistency
somewhere else. Since keywords are re-used all over the place,
some instances of the keyword will require an '@' and some will
not"
From here: https://wiki.dlang.org/Language_Designs_Explained
The error being that the "allowed" in the question is changed to
"required" in the answer. Just because you would be allowed to
use "@pure function()" does not imply that you are required to do
so, you could still also be allowed to use "pure function()".
So why not let all function attributes which are keywords also be
allowed to be used with a "@" prefixed?
More information about the Digitalmars-d
mailing list