Zahns Construct
en.wikipedia.org
en.wikipedia.org
I think of it as an imperative way to pretend you're writing a tail-recursive nest with multiple base cases.
// functional lands
data EC = Situation1 | ... | SituationN
case (Expr0) of
Situation1 -> IOAction1
...
SituationN -> IOActionN
// imperative lands
type Outcome int
const Situation1 Outcome = iota, Situation2, ... SituationN
var outcome Outcome
for {
... { outcome = Situation1; break }
... { outcome = SituationN; break }
}
switch outcome {
case Situation1:
<statements1>
...
case SituationN:
<statementsN>
}
I personally don't think so, Zahn's construct is merely a way to succinctly express such a switch in the control flow. In fact, Rust almost has it, with its loops being expressions.