Multi-exit loops
Alexis Layton
alex at cca.UUCP
Thu Nov 7 10:00:32 AEST 1985
In the most recent SIGPLAN Notices (Vol. 20, No. 11; November 1985) there
is what I consider to be an excellent article by P. A. Buhr entitled
"A Case for Teaching Multi-exit Loops to Beginning Programmers".
While he does make several good points about why beginning programmers should
learn these concepts, the bulk of the article is a very cogent argument about
why languages should support a multi-exit loop construct. He differentiates
between the common of use of C's "break" statement (and equivalent statements
such as Ada's "exit") and a more syntactic loop-exiting statement which can
only occur in the "top-level" (so to speak) of the loop body.
While I primarily agree with his recommendations (and I hope new language
designers are familiar with his reasoning), the kind of loop construct involved
is too foreign to the style of C to integrate it in any way. I fear that
attempts to use the preprocessor to enforce any kind of loop-like construct
are doomed to produce confusing code.
Alexis Layton
Computer Corporation of America
alex at cca-unix.ARPA
decvax!cca!alex
More information about the Comp.lang.c
mailing list