Jeremy G. Siek 2 gadi atpakaļ
vecāks
revīzija
16f33048c1
1 mainītis faili ar 12 papildinājumiem un 12 dzēšanām
  1. 12 12
      book.tex

+ 12 - 12
book.tex

@@ -22655,7 +22655,6 @@ replaced by the deduced type arguments, using the
 \code{substitute\_type} auxiliary function, which is also listed in
 figure~\ref{fig:type-check-Lpoly-aux}.
 
-
 The type checker extends type equality to handle the \code{All} type.
 This is not quite as simple as for other types, such as function and
 tuple types, because two \code{All} types can be syntactically
@@ -23167,7 +23166,7 @@ We use the \CANYTY{} type presented in chapter~\ref{ch:Ldyn} to
 represent type variables. For example, figure~\ref{fig:map-erase}
 shows the output of the \code{erase\_types} pass on the generic
 \code{map} (figure~\ref{fig:map-poly}). The occurrences of
-type parameter \code{a} are replaced by \CANYTY{}, and the generic
+type parameter \code{T} are replaced by \CANYTY{}, and the generic
 \code{All} types are removed from the type of \code{map}. 
 
 \begin{figure}[tbp]
@@ -23228,7 +23227,7 @@ All[[T], Callable[[Callable[[T], T], tuple[T, T]], tuple[T, T]]]
 \end{lstlisting}
 \fi}
 %
-and it is instantiated to 
+\noindent and it is instantiated to 
 %
 {\if\edition\racketEd
 \begin{lstlisting}
@@ -23242,7 +23241,7 @@ Callable[[Callable[[int], int], tuple[int, int]], tuple[int, int]]
 \end{lstlisting}
 \fi}
 %
-After erasure, the type of \code{map} is
+\noindent After erasure, the type of \code{map} is
 %
 {\if\edition\racketEd
 \begin{lstlisting}
@@ -23255,14 +23254,14 @@ Callable[[Callable[[Any], Any], tuple[Any, Any]], tuple[Any, Any]]
 \end{lstlisting}
 \fi}
 %
-but we need to convert it to the instantiated type.  This is easy to
-do in the language \LangCast{} with a single \code{cast}.  In the
-example shown in figure~\ref{fig:map-erase}, the instantiation of
+\noindent but we need to convert it to the instantiated type.  This is
+easy to do in the language \LangCast{} with a single \code{cast}.  In
+the example shown in figure~\ref{fig:map-erase}, the instantiation of
 \code{map} has been compiled to a \code{cast} from the type of
-\code{map} to the instantiated type. The source and the target type of a
-cast must be consistent (figure~\ref{fig:consistent}), which indeed is
-the case because both the source and target are obtained from the same
-generic type of \code{map}, replacing the type parameters with
+\code{map} to the instantiated type. The source and the target type of
+a cast must be consistent (figure~\ref{fig:consistent}), which indeed
+is the case because both the source and target are obtained from the
+same generic type of \code{map}, replacing the type parameters with
 \CANYTY{} in the former and with the deduced type arguments in the
 latter. (Recall that the \CANYTY{} type is consistent with any type.)
 
@@ -23303,7 +23302,8 @@ AllType(|$xs$|, |$T_1$|)
 |$T'_1$|
 \end{lstlisting}
 \fi}
-where $T'_1$ is the result of applying \code{erase\_type} to $T_1$.
+\noindent where $T'_1$ is the result of applying \code{erase\_type} to
+$T_1$.
 %
 In this compiler pass, apply the \code{erase\_type} function to all 
 the type annotations in the program.