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

forkit forkit at gmail.com
Tue Feb 8 01:10:37 UTC 2022


On Monday, 7 February 2022 at 23:38:11 UTC, Walter Bright wrote:
>
> Anytime you find yourself writing not-nohow, not-noway, etc., 
> it's time to redesign the state of the variables. Try to 
> organize logic so ! is not necessary. I mean, try to organize 
> logic so ! is absent.

But sometimes that requires too much effort ;-)

e.g.

!debug { do this }

My brain decided this form of logic without me really thinking at 
all.

Now I have to 'rethink', in order to find the correct form of 
that logic that doesn't require the use of !

nodiscard is better than mustuse for the same reason.

Suppose I don't want to 'use it'. That should be allowed, as long 
as I don't discard it. With mustuse, I'm being told I can't 
discard it, and that i must use it.



More information about the Digitalmars-d-announce mailing list