Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!mailrus!umix!nancy!eecae!fmsrl7!mibte!gamma!ulysses!allegra!alice!ark From: ark@alice.UUCP Newsgroups: comp.lang.c Subject: labelled blocks Message-ID: <7718@alice.UUCP> Date: 29 Feb 88 02:16:50 GMT References: <11702@brl-adm.ARPA> <243@eagle_snax.UUCP> <2245@geac.UUCP> <24996@cca.CCA.COM> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 22 The best scheme I've seen for labelled blocks comes from SETL. In SETL, statements like `IF' and `WHILE' begin blocks which must be ended by `END' statements. Thus one can write: IF x > y THEN max := x; ELSE max := y; END; (I think I have the semicolons right; I'm sure about the one after END) When these structures are nested deeply, one may be confused about just what is being ended. To reduce confusion, the programmer may insert any number of tokens from the opening statement between the END and the semicolon: IF x > y THEN max := x; ELSE max := y; END IF x > y; These tokens are optional, but if they appear, they must match the corresponding tokens from the opening statement.