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

Paul Backus snarwin at gmail.com
Sun Feb 6 15:17:35 UTC 2022


On Sunday, 6 February 2022 at 14:44:40 UTC, Ola Fosheim Grøstad 
wrote:
> On Sunday, 6 February 2022 at 13:33:53 UTC, Paul Backus wrote:
>>
>> @mustUse is a user-defined attribute, and the official style 
>> guide says that names of UDAs should be camelCased:
>
> It is kinda confusing to call it a user-defined attribute if it 
> is recognized by the compiler.

Compiler-recognized UDAs are an established feature of D. See 
[`core.attribute`][1] for more examples.

> I dislike the camel case as well, and the name is less clear 
> than "nodiscard" in my opinion.

I suppose you'll have to take that up with Walter, since he's the 
one who vetoed "nodiscard".

To be honest, though, I can see where he's coming from. When 
writing DIP 1038, I made a conscious effort to avoid using the 
term "non-`@nodiscard`", due to the double negative. With a 
positively-phrased name like `@mustUse`, that problem disappears.

[1]: https://druntime.dpldocs.info/core.attribute.html


More information about the Digitalmars-d-announce mailing list