Loop invariants
Dukc
ajieskola at gmail.com
Thu Oct 3 14:23:57 UTC 2024
On Friday, 27 September 2024 at 18:10:13 UTC, Quirin Schroll
wrote:
> In spirit of [this issue
> comment](https://issues.dlang.org/show_bug.cgi?id=9300#c4), but
> here with better syntax.
Would these invariants be used often? Personally I find that my
assertion usage is almost exclusively plain assertions, in
contracts and unit test assertions. I rarely end up using the
type invariants. I think it'd be even rarer for me to use the
loop invariant. For me personally, this would be needless
complexity.
Maybe it's just me though. What do others think? Do you use (or
would you use, given some kind of project) assertions so
aggressively that you feel this would improve the language?
`invariant` is already a keyword and this isn't much different
from how the existing contracts work so it wouldn't a complex
feature. I therefore think that a significant minority who would
benefit from this would be enough justification for the feature.
It doesn't have to be over 50%.
More information about the dip.ideas
mailing list