4 ms·
You can’t use "finally" because that implies an expression that runs regardless, which this does not (it only runs if the loop never breaks).
by makecheck 8y ago
You can’t use "finally" because that implies an expression that runs regardless, which this does not (it only runs if the loop never breaks).
- jordansmithnz 8y agoYeah, that’s a good point. To me it’s a little more clear than ‘else’ but there might be a better name still that doesn’t suggest this code always runs. Naming is hard :)
- mmebane 8y agoPerhaps `for...lastly...else`? `lastly` being the current meaning of `else` (something that happens after the iteration has completed), `else` being the thing I wish it meant (something that happens when the iterator was empty).