[Oberon] Understanding Oberon07's WHILE loops

chris chris at gcjd.org
Fri Mar 6 22:25:57 CET 2015


Hello,

is the following understanding correct, that given conditions c1/c2 and 
statement sequences s1 and s2:

WHILE c1 DO
  s1
ELSIF c2 DO
  s2
END;

is equivalent to this code:

LOOP
  IF c1 THEN s1
  ELSIF c2 THEN s2
  ELSE EXIT END
END;

The reason I am unsure is the wording in Wirth's "Differences between 
Revised Oberon and Oberon" where it says:
"As long as any of the Boolean expressions yields TRUE, the 
corresponding statement sequence is executed."

In my understanding only at most one statement sequence per iteration 
is executed and that is the first one for which the condition is true.

Greetings, Chris



More information about the Oberon mailing list