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

Daniel N no at public.email
Sun Feb 6 15:14:14 UTC 2022


On Sunday, 6 February 2022 at 13:33:53 UTC, Paul Backus wrote:
> On Sunday, 6 February 2022 at 10:55:20 UTC, Daniel N wrote:
>>
>> Guess I'm way too late, I just find it very strange you 
>> settled on mixedCase, it's not used for anything else. 
>> (nothrow @nogc). I also don't agree with the motivation that 
>> @use is hard to search for because @ is an unusual symbol.
>
> @mustUse is a user-defined attribute, and the official style 
> guide says that names of UDAs should be camelCased:
>
> https://dlang.org/dstyle.html#naming_udas
>
> "Hard to search for" in this context means "hard to Google 
> for", not "hard to grep for". Search engines tend to ignore 
> symbols like @.

If you just google for "dlang attributes" you should be able to 
find what you search for, regardless of what it is called, thus 
personally I think greppability is the only thing we have to 
cater for.

If the attribute is in core or truly built-in feels like an 
implementation detail, if nogc was created today, it also 
probably would have been listed in core.attribute. By using a 
different naming convention we actually block refactoring/cleanup 
of the frontend by moving build-in attributes to the 
core.attribute.

However by choosing "use" we could avoid the entire discussion 
about which case to use...

Best Regards,
Daniel N



More information about the Digitalmars-d-announce mailing list