Ya know… I think part of the reason this is less obvious than it should be is that we don’t have loop-scoped variables for while loops. I’d go a bit further and actually say that:
{ // addiontal outer scope
var i = lo;
while (i < hi) : (i += 1) {
}
}
Is more “idiomatically” a counting loop because we’re preventing i from leaking into the outer world. In my mind, this reads as “the variable i exists for the sole purpose of this loop”.
Loop initialized variables is one thing I wish we had. I’ve thought about some theoretical syntax for this, but that’s a different topic