|
@@ -6401,7 +6401,7 @@ _mainconclusion:
|
|
|
\end{figure}
|
|
|
|
|
|
\begin{exercise}\normalfont
|
|
|
-Expand your compiler to handle $R_4$ as outlined in this section.
|
|
|
+Expand your compiler to handle $R_4$ as outlined in this chapter.
|
|
|
Create 5 new programs that use functions, including examples that pass
|
|
|
functions and return functions from other functions and including
|
|
|
recursive functions. Test your compiler on these new programs and all
|
|
@@ -6874,6 +6874,12 @@ $\Downarrow$
|
|
|
Figure~\ref{fig:R5-passes} provides an overview of all the passes needed
|
|
|
for the compilation of $R_5$.
|
|
|
|
|
|
+\begin{exercise}\normalfont
|
|
|
+Expand your compiler to handle $R_5$ as outlined in this chapter.
|
|
|
+Create 5 new programs that use \key{lambda} functions and make use of
|
|
|
+lexical scoping. Test your compiler on these new programs and all of
|
|
|
+your previously created test programs.
|
|
|
+\end{exercise}
|
|
|
|
|
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
@@ -7405,6 +7411,13 @@ of type \code{Any} in the same way that it treats variables of type
|
|
|
to the root stack instead of the normal procedure call stack.
|
|
|
\end{itemize}
|
|
|
|
|
|
+\begin{exercise}\normalfont
|
|
|
+Expand your compiler to handle $R_6$ as discussed in the last few
|
|
|
+sections. Create 5 new programs that use the \code{Any} type and the
|
|
|
+new operations (\code{inject}, \code{project}, \code{boolean?},
|
|
|
+etc.). Test your compiler on these new programs and all of your
|
|
|
+previously created test programs.
|
|
|
+\end{exercise}
|
|
|
|
|
|
\section{Compiling $R_7$ to $R_6$}
|
|
|
\label{sec:compile-r7}
|
|
@@ -7550,6 +7563,19 @@ $\Rightarrow$
|
|
|
\label{fig:compile-r7-r6}
|
|
|
\end{figure}
|
|
|
|
|
|
+
|
|
|
+\begin{exercise}\normalfont
|
|
|
+Expand your compiler to handle $R_7$ as outlined in this chapter.
|
|
|
+Create tests for $R_7$ by adapting all of your previous test programs
|
|
|
+by removing type annotations. Add 5 more tests programs that
|
|
|
+specifically rely on the language being dynamically typed. That is,
|
|
|
+they should not be legal programs in a statically typed language, but
|
|
|
+nevertheless, they should be valid $R_7$ programs that run to
|
|
|
+completion without error.
|
|
|
+\end{exercise}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
\chapter{Gradual Typing}
|
|
|
\label{ch:gradual-typing}
|