浏览代码

Clarifications and fixes for 2.5

Michael Vollmer 8 年之前
父节点
当前提交
f854d7864c
共有 1 个文件被更改,包括 15 次插入9 次删除
  1. 15 9
      book.tex

+ 15 - 9
book.tex

@@ -1280,7 +1280,7 @@ include at least one \key{return} statement. Each program is also
 annotated with a list of variables (viz. {\tt (var*)}). At the start
 of the program, these variables are uninitialized (they contain garbage)
 and each variable becomes initialized on its first assignment. All of
-the variables used in the program must be present in this list.
+the variables used in the program must be present in this list exactly once.
 
 \begin{figure}[tp]
 \fbox{
@@ -1544,20 +1544,26 @@ should be an integer or a variable. You can return multiple things
 from a function using the \key{values} form and you can receive
 multiple things from a function call using the \key{define-values}
 form. If you are not familiar with these constructs, the Racket
-documentation will be of help. Also, the \key{map3} function
+documentation will be of help.
+Also, the \key{map3} function
 (Appendix~\ref{appendix:utilities}) is useful for applying a function
 to each element of a list, in the case where the function returns
 three values. The result of \key{map3} is three lists.
 
 The clause of \key{flatten} for the \key{program} node needs to
 recursively flatten the body of the program and the newly flattened
-expression should be placed in a \key{return} statement.  The
-\key{flatten} pass should also compute the list of variables used in
-the program.  I recommend traversing the statements in the body of the
-program (after it has been flattened) and collect all variables that
-appear on the left-hand-side of an assignment. Note that each variable
-should only occur once in the list of variables that you place in the
-\key{program} form.
+expression should be placed in a \key{return} statement. Remember that
+the variable list in the \key{program} node should contain no duplicates.
+%% The
+%% \key{flatten} pass should also compute the list of variables used in
+%% the program.
+%% I recommend traversing the statements in the body of the
+%% program (after it has been flattened) and collect all variables that
+%% appear on the left-hand-side of an assignment.
+%% Note that each variable
+%% should only occur once in the list of variables that you place in the
+%% \key{program} form.
+
 
 Take special care for programs such as the following that initialize
 variables with integers or other variables. It should be translated