|
@@ -6440,18 +6440,23 @@ $\Rightarrow$
|
|
|
%
|
|
|
In addition to transforming each \key{lambda} into a \key{vector}, we
|
|
|
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}_n$| (vector-ref clos |$n$|)])
|
|
|
|\itm{body'}|)...))
|
|
|
\end{lstlisting}
|
|
|
+\end{minipage}\\
|
|
|
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
|
|
|
function pointer from the closure and then calls the function, passing
|