Due: October 6, 1999
sum
after the
termination of the loop. A conservative Algol theologian would say "read
section 4.6.4.2" (which defines the semantics of for loops). A liberal
Algol theologian (say a Unitarian) might respond "if section 4.6.4.2 is to
be taken literally, the loop variable i
has a perfectly well
defined value after the loop terminates. But if section 4.6.5 is also to
be taken literally, then i
must be undefined. So we
can't take all parts of section 4.6 literally."
Under the conservative interpretation, what is the value of
sum
and i
after the termination of the loop?
What is the value of sum
and i
after the
termination of the loop under the liberal interpretation? (Since we're
taking the liberal point of view here, you get to choose your own personal
interpretation of the
What are the implications of both views for the implementation of for loops?