|
@@ -22,7 +22,7 @@
|
|
|
|
|
|
\def\racketEd{0}
|
|
|
\def\pythonEd{1}
|
|
|
-\def\edition{0}
|
|
|
+\def\edition{1}
|
|
|
|
|
|
% material that is specific to the Racket edition of the book
|
|
|
\newcommand{\racket}[1]{{\if\edition\racketEd{#1}\fi}}
|
|
@@ -9309,11 +9309,14 @@ The \code{set!} consists of a variable and a right-hand-side
|
|
|
expression. The \code{set!} updates value of the variable to the
|
|
|
value of the right-hand-side.
|
|
|
%
|
|
|
-The primary purpose of both the \code{while} loop and \code{set!} is
|
|
|
-to cause side effects, so it is convenient to also include in a
|
|
|
-language feature for sequencing side effects: the \code{begin}
|
|
|
-expression. It consists of one or more subexpressions that are
|
|
|
-evaluated left-to-right.
|
|
|
+The primary purpose of both the \code{while} loop and \code{set!} is
|
|
|
+to cause side effects, so they do not have a meaningful result
|
|
|
+value. Instead their result is the \code{void} value. The expression
|
|
|
+\code{(void)} is an explicit way to create the \code{void} value. With
|
|
|
+the addition of side-effecting features such as \code{while} loop and
|
|
|
+\code{set!}, it is convenient to also include in a language feature
|
|
|
+for sequencing side effects: the \code{begin} expression. It consists
|
|
|
+of one or more subexpressions that are evaluated left-to-right.
|
|
|
%
|
|
|
\fi
|
|
|
|
|
@@ -10244,14 +10247,16 @@ for the compilation of \LangLoop{}.
|
|
|
%% \margincomment{\scriptsize Be more explicit about how to deal with
|
|
|
%% the root stack. \\ --Jeremy}
|
|
|
|
|
|
-In this chapter we study the implementation of mutable tuples, called
|
|
|
-vectors in Racket. This language feature is the first to use the
|
|
|
-computer's \emph{heap}\index{subject}{heap} because the lifetime of a
|
|
|
-Racket tuple is indefinite, that is, a tuple lives forever from the
|
|
|
-programmer's viewpoint. Of course, from an implementer's viewpoint, it
|
|
|
-is important to reclaim the space associated with a tuple when it is
|
|
|
-no longer needed, which is why we also study \emph{garbage
|
|
|
-collection} \index{garbage collection} techniques in this chapter.
|
|
|
+In this chapter we study the implementation of tuples
|
|
|
+\racket{, called vectors in Racket}.
|
|
|
+%
|
|
|
+This language feature is the first to use the computer's
|
|
|
+\emph{heap}\index{subject}{heap} because the lifetime of a tuple is
|
|
|
+indefinite, that is, a tuple lives forever from the programmer's
|
|
|
+viewpoint. Of course, from an implementer's viewpoint, it is important
|
|
|
+to reclaim the space associated with a tuple when it is no longer
|
|
|
+needed, which is why we also study \emph{garbage collection}
|
|
|
+\index{garbage collection} techniques in this chapter.
|
|
|
|
|
|
Section~\ref{sec:r3} introduces the \LangVec{} language including its
|
|
|
interpreter and type checker. The \LangVec{} language extends the \LangIf{}
|