|
@@ -3762,7 +3762,7 @@ short-circuiting behavior in the order of evaluation of its arguments.
|
|
|
\[
|
|
|
\begin{array}{lcl}
|
|
|
\Type &::=& \gray{\key{Integer} \mid \key{Boolean}}
|
|
|
- \mid (\key{Vector}\;\Type^{+}) \mid \key{Void}\\
|
|
|
+ \mid (\key{Vector}\;\Type^{+}) \mid (\key{Vectorof} \;\Type) \mid \key{Void}\\
|
|
|
\Exp &::=& \gray{\Int \mid (\key{read}) \mid (\key{-}\;\Exp) \mid (\key{+} \; \Exp\;\Exp)} \\
|
|
|
&\mid& \gray{\Var \mid \LET{\Var}{\Exp}{\Exp}
|
|
|
\mid \key{\#t} \mid \key{\#f} \mid
|
|
@@ -3851,6 +3851,9 @@ would run out of memory.\footnote{The $R_3$ language does not have
|
|
|
recursive functions in the next Chapter!} A Racket implementation
|
|
|
must therefore perform automatic garbage collection.
|
|
|
|
|
|
+\marginpar{\tiny todo: add a paragraph about the \key{Vectorof} type. \\ --Jeremy}
|
|
|
+
|
|
|
+
|
|
|
\section{Garbage Collection}
|
|
|
\label{sec:GC}
|
|
|
|
|
@@ -5413,13 +5416,12 @@ compilation of $R_6$ and $R_7$ in the remainder of this chapter.
|
|
|
\begin{figure}[tbp]
|
|
|
\centering
|
|
|
\fbox{
|
|
|
-\begin{minipage}{0.96\textwidth}
|
|
|
+\begin{minipage}{0.97\textwidth}
|
|
|
\[
|
|
|
\begin{array}{lcl}
|
|
|
\Type &::=& \gray{\key{Integer} \mid \key{Boolean}
|
|
|
- \mid (\key{Vector}\;\Type^{+}) \mid \key{Void}
|
|
|
- \mid (\Type^{*} \; \key{->}\; \Type)} \\
|
|
|
- &\mid& \key{Any} \\
|
|
|
+ \mid (\key{Vector}\;\Type^{+}) \mid (\key{Vectorof}\;\Type) \mid \key{Void}} \\
|
|
|
+ &\mid& \gray{(\Type^{*} \; \key{->}\; \Type)} \mid \key{Any} \\
|
|
|
\Exp &::=& \gray{\Int \mid (\key{read}) \mid (\key{-}\;\Exp)
|
|
|
\mid (\key{+} \; \Exp\;\Exp)} \\
|
|
|
&\mid& \gray{\Var \mid \LET{\Var}{\Exp}{\Exp}} \\
|
|
@@ -5440,7 +5442,7 @@ compilation of $R_6$ and $R_7$ in the remainder of this chapter.
|
|
|
\]
|
|
|
\end{minipage}
|
|
|
}
|
|
|
-\caption{The $R_6$ language, an extension of $R_5$
|
|
|
+\caption{The syntax of hte $R_6$ language, an extension of $R_5$
|
|
|
(Figure~\ref{fig:r5-syntax}).}
|
|
|
\label{fig:r6-syntax}
|
|
|
\end{figure}
|
|
@@ -5456,11 +5458,12 @@ to do: type checking
|
|
|
to do: interpreter
|
|
|
|
|
|
\section{The $R_7$ Language: Untyped Racket}
|
|
|
+\label{sec:r7-lang}
|
|
|
|
|
|
\begin{figure}[btp]
|
|
|
\centering
|
|
|
\fbox{
|
|
|
-\begin{minipage}{0.96\textwidth}
|
|
|
+\begin{minipage}{0.97\textwidth}
|
|
|
\[
|
|
|
\begin{array}{rcl}
|
|
|
\Exp &::=& \Int \mid (\key{read}) \mid (\key{-}\;\Exp) \mid (\key{+} \; \Exp\;\Exp) \\
|
|
@@ -5484,6 +5487,16 @@ R_7 &::=& (\key{program} \; \Def^{*}\; \Exp)
|
|
|
|
|
|
Figure~\ref{fig:r7-syntax}
|
|
|
|
|
|
+
|
|
|
+\section{Compiling $R_6$}
|
|
|
+\label{sec:compile-r6}
|
|
|
+
|
|
|
+
|
|
|
+\section{Compiling $R_7$ to $R_6$}
|
|
|
+\label{sec:compile-r7}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
\chapter{Parametric Polymorphism}
|
|
|
\label{ch:parametric-polymorphism}
|