Răsfoiți Sursa

edits to ch 11

Jeremy Siek 2 ani în urmă
părinte
comite
36a7ee2037
1 a modificat fișierele cu 49 adăugiri și 46 ștergeri
  1. 49 46
      book.tex

+ 49 - 46
book.tex

@@ -22150,21 +22150,22 @@ annotations and the body.
 \begin{tcolorbox}[colback=white]  
 \if\edition\racketEd    
 \begin{tikzpicture}[baseline=(current  bounding  box.center),scale=0.85]
-\node (Lpolyp) at (0,4)  {\large \LangInst{}};
-\node (Lgradualp) at (4,4)  {\large \LangCast{}};
-\node (Llambdapp) at (8,4)  {\large \LangProxy{}};
-\node (Llambdaproxy) at (12,4)  {\large \LangPVec{}};
-\node (Llambdaproxy-2) at (12,2)  {\large \LangPVec{}};
-\node (Llambdaproxy-3) at (8,2)  {\large \LangPVec{}};
-\node (Llambdaproxy-4) at (4,2)  {\large \LangPVecFunRef{}};
-\node (Llambdaproxy-5) at (0,2)  {\large \LangPVecFunRef{}};
-\node (F1-1) at (0,0)  {\large \LangPVecFunRef{}};
-\node (F1-2) at (4,0)  {\large \LangPVecFunRef{}};
-\node (F1-3) at (8,0)  {\large \LangPVecFunRef{}};
-\node (F1-4) at (12,0)  {\large \LangPVecAlloc{}};
-\node (F1-5) at (12,-2)  {\large \LangPVecAlloc{}};
-\node (F1-6) at (8,-2)  {\large \LangPVecAlloc{}};
-\node (C3-2) at (4,-2)  {\large \LangCLoopPVec{}};
+\node (Lpoly) at (0,4)  {\large \LangPoly{}};
+\node (Lpolyp) at (4,4)  {\large \LangInst{}};
+\node (Lgradualp) at (8,4)  {\large \LangCast{}};
+\node (Llambdapp) at (12,4)  {\large \LangProxy{}};
+\node (Llambdaproxy) at (12,2)  {\large \LangPVec{}};
+\node (Llambdaproxy-2) at (8,2)  {\large \LangPVec{}};
+\node (Llambdaproxy-3) at (4,2)  {\large \LangPVec{}};
+\node (Llambdaproxy-4) at (0,2)  {\large \LangPVecFunRef{}};
+\node (Llambdaproxy-5) at (0,0)  {\large \LangPVecFunRef{}};
+\node (F1-1) at (4,0)  {\large \LangPVecFunRef{}};
+\node (F1-2) at (8,0)  {\large \LangPVecFunRef{}};
+\node (F1-3) at (12,0)  {\large \LangPVecFunRef{}};
+\node (F1-4) at (12,-2)  {\large \LangPVecAlloc{}};
+\node (F1-5) at (8,-2)  {\large \LangPVecAlloc{}};
+\node (F1-6) at (4,-2)  {\large \LangPVecAlloc{}};
+\node (C3-2) at (0,-2)  {\large \LangCLoopPVec{}};
 
 \node (x86-2) at (0,-4)  {\large \LangXIndCallVar{}};
 \node (x86-2-1) at (0,-6)  {\large \LangXIndCallVar{}};
@@ -22174,31 +22175,33 @@ annotations and the body.
 \node (x86-5) at (8,-6) {\large \LangXIndCall{}};
 
 
+\path[->,bend left=15] (Lpoly) edge [above] node
+     {\ttfamily\footnotesize resolve} (Lpolyp);
 \path[->,bend left=15] (Lpolyp) edge [above] node
      {\ttfamily\footnotesize erase\_types} (Lgradualp);
 \path[->,bend left=15] (Lgradualp) edge [above] node
      {\ttfamily\footnotesize lower\_casts} (Llambdapp);
-\path[->,bend left=15] (Llambdapp) edge [above] node
+\path[->,bend left=15] (Llambdapp) edge [left] node
      {\ttfamily\footnotesize differentiate\_proxies} (Llambdaproxy);
-\path[->,bend left=15] (Llambdaproxy) edge [left] node
+\path[->,bend left=15] (Llambdaproxy) edge [below] node
      {\ttfamily\footnotesize shrink} (Llambdaproxy-2);
-\path[->,bend left=15] (Llambdaproxy-2) edge [above] node
+\path[->,bend right=15] (Llambdaproxy-2) edge [above] node
      {\ttfamily\footnotesize uniquify} (Llambdaproxy-3);
 \path[->,bend right=15] (Llambdaproxy-3) edge [above] node
      {\ttfamily\footnotesize reveal\_functions} (Llambdaproxy-4);
-\path[->,bend right=15] (Llambdaproxy-4) edge [above] node
+\path[->,bend right=15] (Llambdaproxy-4) edge [right] node
      {\ttfamily\footnotesize reveal\_casts} (Llambdaproxy-5);
-\path[->,bend right=15] (Llambdaproxy-5) edge [right] node
+\path[->,bend right=15] (Llambdaproxy-5) edge [below] node
      {\ttfamily\footnotesize convert\_assignments} (F1-1);
-\path[->,bend right=15] (F1-1) edge [below] node
+\path[->,bend left=15] (F1-1) edge [above] node
      {\ttfamily\footnotesize convert\_to\_closures} (F1-2);
 \path[->,bend left=15] (F1-2) edge [above] node
      {\ttfamily\footnotesize limit\_functions} (F1-3);
-\path[->,bend left=15] (F1-3) edge [above] node
+\path[->,bend left=15] (F1-3) edge [left] node
      {\ttfamily\footnotesize expose\_allocation} (F1-4);
-\path[->,bend left=15] (F1-4) edge [left] node
+\path[->,bend left=15] (F1-4) edge [below] node
      {\ttfamily\footnotesize uncover\_get!} (F1-5);
-\path[->,bend left=15] (F1-5) edge [below] node
+\path[->,bend right=15] (F1-5) edge [above] node
      {\ttfamily\footnotesize remove\_complex\_operands} (F1-6);
 \path[->,bend right=15] (F1-6) edge [above] node
      {\ttfamily\footnotesize explicate\_control} (C3-2);
@@ -22301,7 +22304,7 @@ needed to compile \LangPoly{}.
 \index{subject}{interpreter}
 
 We provide interpreters for each of the source languages \LangInt{},
-\LangVar{}, $\ldots$ in the files \code{interp\_Lint.rkt},
+\LangVar{}, $\ldots$ in the files \code{interp-Lint.rkt},
 \code{interp-Lvar.rkt}, and so on.  The interpreters for the
 intermediate languages \LangCVar{} and \LangCIf{} are in
 \code{interp-Cvar.rkt} and \code{interp-C1.rkt}.  The interpreters for
@@ -22316,10 +22319,9 @@ The utility functions described in this section are in the
 
 \paragraph{\code{interp-tests}}
 
-The \key{interp-tests} function runs the compiler passes and the
-interpreters on each of the specified tests to check whether each pass
-is correct. The \key{interp-tests} function has the following
-parameters:
+This function runs the compiler passes and the interpreters on each of
+the specified tests to check whether each pass is correct. The
+\key{interp-tests} function has the following parameters:
 \begin{description}
 \item[name (a string)] A name to identify the compiler,
 \item[typechecker] A function of exactly one argument that either
@@ -22365,11 +22367,11 @@ the same name with extension \key{.tyerr}.
 
 \paragraph{\code{compiler-tests}}
 
-Runs the compiler passes to generate x86 (a \key{.s} file) and then
-runs the GNU C compiler (gcc) to generate machine code.  It runs the
-machine code and checks that the output is $42$. The parameters to the
-\code{compiler-tests} function are similar to those of the
-\code{interp-tests} function, and they consist of
+This function runs the compiler passes to generate x86 (a \key{.s}
+file) and then runs the GNU C compiler (gcc) to generate machine code.
+It runs the machine code and checks that the output is $42$. The
+parameters to the \code{compiler-tests} function are similar to those
+of the \code{interp-tests} function, and they consist of
 \begin{itemize}
 \item a compiler name (a string),
 \item a type checker,
@@ -22381,32 +22383,33 @@ machine code and checks that the output is $42$. The parameters to the
 
 \paragraph{\code{compile-file}}
 
-Takes a description of the compiler passes (see the comment for
-\key{interp-tests}) and returns a function that, given a program file
-name (a string ending in \key{.rkt}), applies all the passes and
-writes the output to a file whose name is the same as the program file
-name with extension \key{.rkt} replaced by \key{.s}.
+This function takes a description of the compiler passes (see the
+comment for \key{interp-tests}) and returns a function that, given a
+program file name (a string ending in \key{.rkt}), applies all the
+passes and writes the output to a file whose name is the same as the
+program file name with extension \key{.rkt} replaced by \key{.s}.
 
 
 \paragraph{\code{read-program}}
 
-Takes a file path and parses that file (it must be a Racket program)
-into an abstract syntax tree.
+This function takes a file path and parses that file (it must be a
+Racket program) into an abstract syntax tree.
 
 \paragraph{\code{parse-program}}
 
-Takes an S-expression representation of an abstract syntax tree and
-converts it into the struct-based representation.
+This function takes an S-expression representation of an abstract
+syntax tree and converts it into the struct-based representation.
 
 \paragraph{\code{assert}}
 
-Takes two parameters, a string (\code{msg}) and Boolean (\code{bool}),
-and displays the message \key{msg} if the Boolean \key{bool} is false.
+This function takes two parameters, a string (\code{msg}) and Boolean
+(\code{bool}), and displays the message \key{msg} if the Boolean
+\key{bool} is false.
 
 \paragraph{\code{lookup}}
 
 % remove discussion of lookup? -Jeremy
-takes a key and an alist and returns the first value that is
+This function takes a key and an alist and returns the first value that is
 associated with the given key, if there is one. If not, an error is
 triggered.  The alist may contain both immutable pairs (built with
 \key{cons}) and mutable pairs (built with \key{mcons}).