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

forkit forkit at gmail.com
Tue Feb 8 01:53:17 UTC 2022


On Tuesday, 8 February 2022 at 01:40:38 UTC, forkit wrote:
>
> I often say to my cat 'what are you doing' .. but what i really 
> mean is 'don't do that'.
>
> by avoiding negation, I'm probably just confusing my cat as to 
> what i really meant.
>
> mustuse -> I must use it? Why must i use it? How must I use it? 
> What happens if
> i don't use it.
>
> nodiscard -> don't discard it. nice and simple (just like 
> 'don't do that').

I guess the question really is:

What it the most important concept you are relaying to the 
programmer by the use of that term?

That they 'must use it'.

Or, that they 'cannot discard it'.

They seem like two different concepts to me.

I don't believe that using nodiscard in C++, means you must use 
it.

If in D, it means you must use it, then 'mustuse' makes more 
sense.

If not, then stick with what people already know, is my advice.




More information about the Digitalmars-d-announce mailing list