[Oberon] Re (2): Porting S3 / V4 Oberon
August Karlstrom
fusionfile at gmail.com
Sun Jan 3 16:50:06 CET 2021
On 2021-01-03 16:08, peter at easthope.ca wrote:
> What about tolerating RETURN and EXIT but not LOOP?
If we exit prematurely from a WHILE, REPEAT or FOR statement our code is
potentially lying. If we read
WHILE someCondition DO
...
END
we should be able to conclude that the guarded statements are repeated
as long as someCondition is true, and that someCondition is false when
(or if) the loop has finished. That's the beauty of a purely structured
language such as (the latest) Oberon; there are no partially executed
statement sequences (unless the ASSERT statement is being used). Compare
this to
WHILE someCondition DO
...
IF someOtherCondition THEN
EXIT (*ugh!*)
END;
...
IF someThirdCondition THEN
RETURN (*ugh!*)
END;
...
END
(*~someCondition???*)
-- August
More information about the Oberon
mailing list