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

apz28 home at home.com
Wed Feb 9 18:31:29 UTC 2022


On Wednesday, 9 February 2022 at 16:21:24 UTC, Paul Backus wrote:
> On Wednesday, 9 February 2022 at 14:30:30 UTC, Guillaume Piolat 
> wrote:
>> On Monday, 7 February 2022 at 19:57:28 UTC, forkit wrote:
>>> First, I'm not 'insisting' on anything. I'm just expressing a 
>>> view.
>>>
>>> nodiscard is already used by more programmers that D is 
>>> likely to ever adopt.
>>>
>>> Indeed, it's these programmers that D is trying to adopt.
>>>
>>> I'm not sure forcing such people to adapt is necessarily the 
>>> right approach.
>>>
>>
>> I'll have to side with forkit there.
>>
>> In audio software (at the very least) you pay very dearly the 
>> price of introducing new _words_, because the existing words 
>> embodies existing meaning and practice that users have 
>> internalized.
>
> In D, there is no existing word for this, so from that 
> perspective both "mustuse" and "nodiscard" are equally valid.
>
> In other languages, there are multiple existing words:
>
> - C++17: [[nodiscard]]
> - C (gcc/clang): __attribute__((warn_unused_result))
> - Rust: #[must_use]
>

C++17: [[nodiscard]] is just a warning; must use another compiler 
flag in order to have same @mustuse in D -> already discrepancy 
in meaning



More information about the Digitalmars-d-announce mailing list