Jeremy Siek 6 年之前
父节点
当前提交
1e84a3ccd5
共有 1 个文件被更改,包括 11 次插入6 次删除
  1. 11 6
      book.tex

+ 11 - 6
book.tex

@@ -6440,18 +6440,23 @@ $\Rightarrow$
 %
 %
 In addition to transforming each \key{lambda} into a \key{vector}, we
 In addition to transforming each \key{lambda} into a \key{vector}, we
 must create a top-level function definition for each \key{lambda}, as
 must create a top-level function definition for each \key{lambda}, as
-shown below.
-\begin{lstlisting}
-   (define (|\itm{name}| [clos : _] |\itm{ps}| ...)
+shown below.\\
+\begin{minipage}{0.8\textwidth}
+  \begin{lstlisting}
+   (define (|\itm{name}| [clos : (Vector _ |\itm{fvts}| ...)] |\itm{ps}| ...)
       (let ([|$\itm{fvs}_1$| (vector-ref clos 1)])
       (let ([|$\itm{fvs}_1$| (vector-ref clos 1)])
         ...
         ...
         (let ([|$\itm{fvs}_n$| (vector-ref clos |$n$|)])
         (let ([|$\itm{fvs}_n$| (vector-ref clos |$n$|)])
           |\itm{body'}|)...))
           |\itm{body'}|)...))
 \end{lstlisting}
 \end{lstlisting}
+\end{minipage}\\
 The \code{clos} parameter refers to the closure whereas $\itm{ps}$ are
 The \code{clos} parameter refers to the closure whereas $\itm{ps}$ are
-the normal parameters of the \key{lambda}. The sequence of \key{let}
-forms being the free variables to their values obtained from the
-closure.
+the normal parameters of the \key{lambda}. The types $\itm{fvts}$ are
+the types of the free variables in the lambda and the underscore is a
+dummy type because it is rather difficult to give a type to the
+function in the closure's type, and it does not matter.  The sequence
+of \key{let} forms being the free variables to their values obtained
+from the closure.
 
 
 We transform function application into code that retreives the
 We transform function application into code that retreives the
 function pointer from the closure and then calls the function, passing
 function pointer from the closure and then calls the function, passing