All function attributes possible with "@"?

HaraldZealot via Digitalmars-d digitalmars-d at puremagic.com
Wed Dec 14 01:37:29 PST 2016


On Wednesday, 14 December 2016 at 03:49:23 UTC, Jonathan M Davis 
wrote:
> On Tuesday, 13 December 2016 at 22:40:47 UTC, 01010100b wrote:
>
> The _only_ way to eliminate all of the inconsistencies with @ 
> is to get rid of it from everywhere but UDAs, and turn all of 
> those built-in attributes into full-blown keywords, and we're 
> simply not going to do that. Any other solution is just moving 
> the inconsistencies around.

Almost. We have other very promising options: make them 
context-keyword (this possibility already one of considerable 
solution for "body" DIP). If we introduce context-keyword then 
language designer are freed to add any new language defined 
attributes, which will be not clashed with user defined 
attributes, and OTOH not introduce full-blown keyword which clash 
with other user symbol. But as preliminary work we need probably 
to favour one style of context (e.g. all attributes appears after 
function declaration not before, there is also (possible 
solvable) problem how to interpret no-one function declaration 
`pure:` and `pure{}`).

Probably we can go even further: split the whole set of keywords 
into 3 subsets: full-blown keyword (like `if`, `while` etc, 
probably it also time to restyle `traits`), context-keywords 
(like mentioned attribution, probably even `private`, `public` 
etc can be made context-keyword, and even further `const`, 
`immutable` etc) but with very stric and i/e quick parse-able 
context, and intrinsic types (`int`, `ulong` etc, because some of 
them especially `real` should be made platform specific) swhich 
almost full-blown keyword, with only point that you not 
guaranteed have all of them  on your platform




More information about the Digitalmars-d mailing list