N. Wirth's Oberon-07 had a different use case for the ELSIF keywords in loops. They delimited different exit conditions and the corresponding code blocks. Example (the Euclidean algorithm): WHILE...
N. Wirth's Oberon-07 had a different use case for the
ELSIF keywords in loops. They delimited different exit
conditions and the corresponding code blocks. Example (the Euclidean
algorithm):
Wirth himself calls it (PDF) “Dijkstra's form”, although Google doesn't seem to know that name. So you could do something like: EWD m > n DO m := m – n ELSIF n > m DO n := n – m END
Wirth himself
calls it (PDF)
“Dijkstra's form”, although Google doesn't seem to know that name. So
you could do something like:
EWD m > n DO
m := m – n
ELSIF n > m DO
n := n – m
END
N. Wirth's Oberon-07 had a different use case for the
ELSIF
keywords in loops. They delimited different exit conditions and the corresponding code blocks. Example (the Euclidean algorithm):This is equivalent to the C code:
(There is another way of writing it in C, but this one is closer to the Oberon-07 version.)
I had that as a proposed loop in my language. I had named it the
coil
loop. I have since dropped it.Wirth himself calls it (PDF) “Dijkstra's form”, although Google doesn't seem to know that name. So you could do something like:
That's smart! Since it pretty much explores in a way.
I wrote my notes here:
https://github.com/Apostolique/Vyne-Language