|
@@ -811,7 +811,7 @@ just the empty list.
|
|
|
\begin{ocamlx}
|
|
|
In OCaml:
|
|
|
\begin{lstlisting}[style=ocaml]
|
|
|
- type 'info rint_program = Program of 'info * exp
|
|
|
+ type 'info program = Program of 'info * exp
|
|
|
\end{lstlisting}
|
|
|
Again, we represent the structure as a variant type
|
|
|
(\code{rint\_program}), this time just with one constructor
|
|
@@ -823,7 +823,7 @@ just the empty list.
|
|
|
with the \emph{unit} type, written \code{unit}, whose sole (boring)
|
|
|
value is written \code{()}.
|
|
|
\begin{lstlisting}[style=ocaml]
|
|
|
- let p : unit rint_program = Program () body
|
|
|
+ let p : unit program = Program () body
|
|
|
\end{lstlisting}
|
|
|
Here the colon (\code{:}) introduces an explicit type annotation on \code{p}; it can be read ``has type.''
|
|
|
\end{ocamlx}
|
|
@@ -938,7 +938,7 @@ type primop =
|
|
|
type exp =
|
|
|
Int of int
|
|
|
| Prim of primop * exp list
|
|
|
-type 'info rint_program = Program of 'info * exp
|
|
|
+type 'info program = Program of 'info * exp
|
|
|
\end{lstlisting}
|
|
|
\end{minipage}
|
|
|
\caption{The abstract syntax of \LangInt{}.}
|