|
@@ -16795,7 +16795,7 @@ involves manipulating tagged values, the representation must be
|
|
|
efficient. Recall that all of our values are 64 bits. We shall steal
|
|
|
the 3 right-most bits to encode the tag. We use $001$ to identify
|
|
|
integers, $100$ for Booleans, $010$ for vectors, $011$ for procedures,
|
|
|
-and $101$ for the void value. We define the following auxiliary
|
|
|
+and $101$ for the void value\python{, \key{None}}. We define the following auxiliary
|
|
|
function for mapping types to tag codes.
|
|
|
{\if\edition\racketEd
|
|
|
\begin{align*}
|
|
@@ -16815,8 +16815,8 @@ function for mapping types to tag codes.
|
|
|
\itm{tagof}(\key{type(None)}) &= 101
|
|
|
\end{align*}
|
|
|
\fi}
|
|
|
-This stealing of 3 bits comes at some price: our integers are reduced
|
|
|
-to ranging from $-2^{60}$ to $2^{60}$. The stealing does not adversely
|
|
|
+This stealing of 3 bits comes at some price: integers are now restricted
|
|
|
+to the range from $-2^{60}$ to $2^{60}$. The stealing does not adversely
|
|
|
affect vectors and procedures because those values are addresses, and
|
|
|
our addresses are 8-byte aligned so the rightmost 3 bits are unused,
|
|
|
they are always $000$. Thus, we do not lose information by overwriting
|
|
@@ -16931,7 +16931,8 @@ Note that in both \code{Inject} and \code{Project}, the type $T$ is
|
|
|
restricted to a flat type $\FType$, which simplifies the
|
|
|
implementation and corresponds with the needs for compiling \LangDyn{}.
|
|
|
|
|
|
-The \racket{\code{any-vector}}\python{\code{any\_tuple}} operators
|
|
|
+The \racket{\code{any-vector}} operators
|
|
|
+\python{\code{any\_tuple\_load} and \code{any\_len}}
|
|
|
adapt the tuple operations so that they can be applied to a value of
|
|
|
type \racket{\code{Any}}\python{\code{AnyType}}. They also generalize the
|
|
|
tuple operations in that the index is not restricted to be a literal
|
|
@@ -18098,7 +18099,7 @@ not a tuple. We enable this differentiation by choosing not to use the
|
|
|
tag $000$ in the $\itm{tagof}$ function. Instead, that bit pattern is
|
|
|
reserved for identifying plain old pointers to tuples. That way, if
|
|
|
one of the first three bits is set, then we have a tagged value and
|
|
|
-inspecting the tag can differentiation between tuples ($010$) and the
|
|
|
+inspecting the tag can differentiate between tuples ($010$) and the
|
|
|
other kinds of values.
|
|
|
|
|
|
%% \begin{exercise}\normalfont
|