Differences between version 4 and revision by previous author of GoToStatementConsideredHarmful.
Other diffs: Previous Major Revision, Previous Revision, or view the Annotated Edit History
Newer page: | version 4 | Last edited on Monday, December 1, 2003 10:31:30 pm | by CraigBox | Revert |
Older page: | version 3 | Last edited on Tuesday, November 11, 2003 4:46:37 pm | by AristotlePagaltzis | Revert |
@@ -17,9 +17,9 @@
My second remark is that our intellectual powers are rather geared to master static relations and that our powers to visualize processes evolving in time are relatively poorly developed. For that reason we should do (as wise programmers aware of our limitations) our utmost to shorten the conceptual gap between the static program and the dynamic process, to make the correspondence between the program (spread out in text space) and the process (spread out in time) as trivial as possible.
Let us now consider how we can characterize the progress of a process. (You may think about this question in a very concrete manner: suppose that a process, considered as a time succession of actions, is stopped after an arbitrary action, what data do we have to fix in order that we can redo the process until the very same point?) If the program text is a pure concatenation of, say, assignment statements (for the purpose of this discussion regarded as the descriptions of single actions) it is sufficient to point in the program text to a point between two successive action descriptions. (In the absence of GoTo statements I can permit myself the syntactic ambiguity in the last three words of the previous sentence: if we parse them as "successive (action descriptions)" we mean successive in text space; if we parse as "(successive action) descriptions" we mean successive in time.) Let us call such a pointer to a suitable place in the text a "textual index."
-When we include conditional clauses (''if B then A''), alternative clauses (''if B then A1 else A2''), choice clauses as introduced by CharlesAnthonyRichardHoare
(''case[[i] of (A1, A2,···, An)''),or conditional expressions as introduced by J. !McCarthy (''B1 -> E1, B2 -> E2, ···, Bn -> En''), the fact remains that the progress of the process remains characterized by a single textual index.
+When we include conditional clauses (''if B then A''), alternative clauses (''if B then A1 else A2''), choice clauses as introduced by CharlesAntonyRichardHoare
(''case[[i] of (A1, A2,···, An)''),or conditional expressions as introduced by J. !McCarthy (''B1 -> E1, B2 -> E2, ···, Bn -> En''), the fact remains that the progress of the process remains characterized by a single textual index.
As soon as we include in our language procedures we must admit that a single textual index is no longer sufficient. In the case that a textual index points to the interior of a procedure body the dynamic progress is only characterized when we also give to which call of the procedure we refer. With the inclusion of procedures we can characterize the progress of the process via a sequence of textual indices, the length of this sequence being equal to the dynamic depth of procedure calling.
Let us now consider repetition clauses (like, ''while B repeat A'' or ''repeat A until B''). Logically speaking, such clauses are now superfluous, because we can express repetition with the aid of recursive procedures. For reasons of realism I don't wish to exclude them: on the one hand, repetition clauses can be implemented quite comfortably with present day finite equipment; on the other hand, the reasoning pattern known as "induction" makes us well equipped to retain our intellectual grasp on the processes generated by repetition clauses. With the inclusion of the repetition clauses textual indices are no longer sufficient to describe the dynamic progress of the process. With each entry into a repetition clause, however, we can associate a so-called "dynamic index," inexorably counting the ordinal number of the corresponding current repetition. As repetition clauses (just as procedure calls) may be applied nestedly, we find that now the progress of the process can always be uniquely characterized by a (mixed) sequence of textual and/or dynamic indices.