Jeremy Siek 6 жил өмнө
parent
commit
98c52b60e3
1 өөрчлөгдсөн 20 нэмэгдсэн , 16 устгасан
  1. 20 16
      book.tex

+ 20 - 16
book.tex

@@ -5444,21 +5444,21 @@ for the compilation of $R_3$.
 \chapter{Functions}
 \chapter{Functions}
 \label{ch:functions}
 \label{ch:functions}
 
 
-This chapter studies the compilation of functions (aka. procedures) at
-the level of abstraction of the C language. This corresponds to a
-subset of Typed Racket in which only top-level function definitions
-are allowed. This abstraction level is an important stepping stone to
-implementing lexically-scoped functions in the form of \key{lambda}
-abstractions (Chapter~\ref{ch:lambdas}).
+This chapter studies the compilation of functions at the level of
+abstraction of the C language. This corresponds to a subset of Typed
+Racket in which only top-level function definitions are allowed. These
+kind of functions are an important stepping stone to implementing
+lexically-scoped functions in the form of \key{lambda} abstractions,
+which is the topic of Chapter~\ref{ch:lambdas}.
 
 
 \section{The $R_4$ Language}
 \section{The $R_4$ Language}
 
 
-The syntax for function definitions and function application
-(aka. function call) is shown in Figure~\ref{fig:r4-syntax}, where we
-define the $R_4$ language.  Programs in $R_4$ start with zero or more
-function definitions.  The function names from these definitions are
-in-scope for the entire program, including all other function
-definitions (so the ordering of function definitions does not matter).
+The syntax for function definitions and function application is shown
+in Figure~\ref{fig:r4-syntax}, where we define the $R_4$ language.
+Programs in $R_4$ start with zero or more function definitions.  The
+function names from these definitions are in-scope for the entire
+program, including all other function definitions (so the ordering of
+function definitions does not matter).
 
 
 Functions are first-class in the sense that a function pointer is data
 Functions are first-class in the sense that a function pointer is data
 and can be stored in memory or passed as a parameter to another
 and can be stored in memory or passed as a parameter to another
@@ -5472,7 +5472,7 @@ these functions (with respect to Racket functions) is that they are
 not lexically scoped. That is, the only external entities that can be
 not lexically scoped. That is, the only external entities that can be
 referenced from inside a function body are other globally-defined
 referenced from inside a function body are other globally-defined
 functions. The syntax of $R_4$ prevents functions from being nested
 functions. The syntax of $R_4$ prevents functions from being nested
-inside each other; they can only be defined at the top level.
+inside each other.
 
 
 \begin{figure}[tp]
 \begin{figure}[tp]
 \centering
 \centering
@@ -5493,7 +5493,7 @@ inside each other; they can only be defined at the top level.
   &\mid& \gray{(\key{vector-set!}\;\Exp\;\Int\;\Exp)\mid (\key{void})} \\
   &\mid& \gray{(\key{vector-set!}\;\Exp\;\Int\;\Exp)\mid (\key{void})} \\
       &\mid& (\Exp \; \Exp^{*}) \\
       &\mid& (\Exp \; \Exp^{*}) \\
   \Def &::=& (\key{define}\; (\Var \; [\Var \key{:} \Type]^{*}) \key{:} \Type \; \Exp) \\
   \Def &::=& (\key{define}\; (\Var \; [\Var \key{:} \Type]^{*}) \key{:} \Type \; \Exp) \\
-  R_4 &::=& (\key{program} \; \Def^{*} \; \Exp)
+  R_4 &::=& (\key{program} \;\itm{info}\; \Def^{*} \; \Exp)
 \end{array}
 \end{array}
 \]
 \]
 \end{minipage}
 \end{minipage}
@@ -5513,7 +5513,7 @@ that does what its name suggests. The program then applies
 
 
 \begin{figure}[tbp]
 \begin{figure}[tbp]
 \begin{lstlisting}
 \begin{lstlisting}
-(program
+(program ()
   (define (map-vec [f : (Integer -> Integer)]
   (define (map-vec [f : (Integer -> Integer)]
                      [v : (Vector Integer Integer)])
                      [v : (Vector Integer Integer)])
           : (Vector Integer Integer)
           : (Vector Integer Integer)
@@ -5528,7 +5528,11 @@ that does what its name suggests. The program then applies
 \end{figure}
 \end{figure}
 
 
 The definitional interpreter for $R_4$ is in
 The definitional interpreter for $R_4$ is in
-Figure~\ref{fig:interp-R4}.
+Figure~\ref{fig:interp-R4}. The case for the
+\code{program} form 
+
+UNDER CONSTRUCTION
+
 
 
 \begin{figure}[tp]
 \begin{figure}[tp]
 \begin{lstlisting}
 \begin{lstlisting}