11 ms·
A Ruby-like “until” or Pascal “repeat...until” (C’s do...while is equivalent but less clear choice of keywords, IMO.) The Pascal form wouldn't really fit Python
by dragonwriter 5y ago
A Ruby-like “until” or Pascal “repeat...until” (C’s do...while is equivalent but less clear choice of keywords, IMO.) The Pascal form wouldn't really fit Python's indentation-without-closing-marker block syntax preference, but the Ruby version would.
If it existed, I’d be tempted to suggest a linter rule that prohibits break inside an until (it should only be used when the main exit condition is the only exit condition.)
- dragonwriter 5y agoToo late to correct, but I can tell I haven't been using Ruby much for a while; Ruby until is just negated while, like C it uses while (or until!) at the end for Pascal-style repeat...until logic.