DIP 1038--"@mustUse" (formerly "@noDiscard")--Accepted

Paul Backus snarwin at gmail.com
Sun Feb 6 14:56:42 UTC 2022


On Sunday, 6 February 2022 at 14:32:31 UTC, Paolo Invernizzi 
wrote:
> While I like a lot and welcome the addition of this attribute 
> (so thank you!), I humbly  ask to reconsider using   the full 
> lowercase alternative instead of camel case.
>
> Let's conform with the other built-in attributes listed into 
> the specs of the language, avoiding what would be another 
> special case to remember.

There is precedent for compiler-recognized UDAs using camelCase 
in core.attribute.gnuAbiTag [1], as well as the various 
LDC-specific attributes [2]. So no matter what I choose here, it 
will be inconsistent with something.

If you strongly prefer the lower-case version, you can always 
rename it in your own code:

     import core.attribute: mustuse = mustUse;

     @mustuse struct MyStruct
     {
         // ...
     }

[1]: https://druntime.dpldocs.info/core.attribute.gnuAbiTag.html
[2]: 
https://wiki.dlang.org/LDC-specific_language_changes#Attributes


More information about the Digitalmars-d-announce mailing list