To me, the else isn’t intuitive if you haven’t encountered it before. It’s a nice feature, but perhaps better naming could improve code readability.
How about for-finally? It’s a hard thing to name correctly, but to me this seems to be slightly more intuitive if you’ve never seen the feature before.
Yeah, 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 :)
Perhaps `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).
How about for-finally? It’s a hard thing to name correctly, but to me this seems to be slightly more intuitive if you’ve never seen the feature before.