RFC: DIP draft for "Compiler-defined Attribute Consistency"

Rune Morling ermo at serpentos.com
Thu Jul 15 19:26:43 UTC 2021


On Thursday, 15 July 2021 at 00:59:28 UTC, rikki cattermole wrote:
>
> On 15/07/2021 4:19 AM, Dennis wrote:
>> On Wednesday, 14 July 2021 at 16:02:01 UTC, Andrea Fontana 
>> wrote:
>>> It would be nice to have # for attr and @ for uda (or 
>>> viceversa).
>> 
>> That conflicts with #line directives.
>
> It doesn't.
>
> #line checks for the identifier line as part of the lexer, and 
> language defined attributes do not include line. So no 
> conflicts :)

Is e.g. `@+myuda`, `@-myuda` or `@_myuda` legal?

As long as you can decorate with a consistent extra single 
character, wouldn't it be entirely possible (and perhaps even 
advantageous?) to use a commonly accepted best practice/idiom in 
order to distinguish user-defined attributes from 
compiler-defined attributes without needing to change the grammar?


More information about the Digitalmars-d mailing list