
\documentclass[a4paper]{article}
\usepackage{amsmath,amssymb,amsthm}
\usepackage[utf8]{inputenc}

\newenvironment{class}{\vspace{1cm}}{}
\newcommand{\code}[1]{\texttt{\bfseries{}{#1}}}
\newcommand{\classname}[1]{\noindent{}Class: \code{#1}\newline}
\newcommand{\superclass}[1]{\noindent{}Superclass: \code{#1}\newline}
%%\newenvironment{field}{\mbox{ }\vspace{0.5cm}\mbox{ }}{}
\newenvironment{field}{}{}
\newcommand{\fieldname}[1]{\par\noindent{}Field: \code{#1}\newline}
\newcommand{\fieldtype}[1]{Type: \code{#1}\newline}
%%\newenvironment{fieldtype}{\ttfamily\bfseries{}}{}
\newenvironment{fielddesc}{Description:\rmfamily\mdseries{}}{\newline}
\newcommand{\themetrue}{\code{\#t}}
\newcommand{\themefalse}{\code{\#f}}
\newcommand{\theme}{Theme-D}
\newenvironment{targetclass}{\vspace{1cm}}{}
\newcommand{\targetclassname}[1]{\noindent{}Target class: \code{#1}\newline}
\newcommand{\targetsuperclass}[1]{\noindent{}Superclass: \code{#1}\newline}
\newenvironment{targetfield}{}{}
\newcommand{\targetfieldname}[1]{\par\noindent{}Field: \code{#1}\newline}
\newcommand{\targetfieldtype}[1]{Type: \code{#1}\newline}
\newenvironment{targetfielddesc}{Description:\rmfamily\mdseries{}}{\newline}
\newcommand{\targetclassinh}{\textit{inheritable}\newline}
\newcommand{\targetclassnotinh}{\textit{not inheritable}\newline}
\newcommand{\targetclassimm}{\textit{immutable}\newline}
\newcommand{\targetclassmut}{\textit{mutable}\newline}
\newcommand{\targetclassebv}{\textit{equal by value}\newline}
%% mieti termi seuraavassa
\newcommand{\targetclassnotebv}{\textit{equal by reference}\newline}
\newcommand{\targetclassnofields}{\par\noindent{}No own fields}

\begin{document}

\begin{class}
  \classname{<entity>}
  \begin{field}
    \fieldname{type}
    \fieldtype{(:union <target-object> <boolean>)}
    \begin{fielddesc}
      Data type of the expression
    \end{fielddesc}
  \end{field}
  \begin{field}
    \fieldname{type-dispatched?}
    \fieldtype{<boolean>}
    \begin{fielddesc}
      \themetrue\ if the data type of the expression
      has been dispatched
    \end{fielddesc}
  \end{field}
  \begin{field}
    \fieldname{exact-type?}
    \fieldtype{<boolean>}
    \begin{fielddesc}
      \themetrue\ if the data type of the expression is exact
    \end{fielddesc}
  \end{field}
  \begin{field}
    \fieldname{address}
    \fieldtype{(:maybe <address>)}
    \begin{fielddesc}
      The address with which the entity can be accessed.
    \end{fielddesc}
  \end{field}
\end{class}

\begin{class}
  \classname{<expression>}
  \superclass{<entity>}
  \begin{field}
    \fieldname{pure?}
    \fieldtype{<boolean>}
    \begin{fielddesc}
      \themetrue\ if the expression is pure, i.e. it is guaranteed to
      have no side effects
    \end{fielddesc}
  \end{field}
  \begin{field}
    \fieldname{static?}
    \fieldtype{<boolean>}
    \begin{fielddesc}
      This field is not used.
    \end{fielddesc}
  \end{field}
  \begin{field}
    \fieldname{need-revision?}
    \fieldtype{<boolean>}
    \begin{fielddesc}
      Set \themetrue\ in order to force revision of the expression
      during parametrized object instantiation.
    \end{fielddesc}
  \end{field}
  \begin{field}
    \fieldname{to-value}
    \fieldtype{(:maybe <target-object>)}
    \begin{fielddesc}
      The value of the expression. Set this field to \code{null} if the
      value is not known.
    \end{fielddesc}
  \end{field}
\end{class}

\begin{class}
  \classname{<target-object>}
  \superclass{<entity>}
  \begin{field}
    \fieldname{primitive?}
    \fieldtype{<boolean>}
    \begin{fielddesc}
      \themetrue\ iff the class of the object is a primitive class
      and the other fields are set accordingly
    \end{fielddesc}
  \end{field}
  \begin{field}
    \fieldname{incomplete?}
    \fieldtype{<boolean>}
    \begin{fielddesc}
      \themetrue\ iff the object is incomplete, i.e. its fields are not known
    \end{fielddesc}
  \end{field}
  \begin{field}
    \fieldname{al-field-values}
    \fieldtype{(:union (:uniform-list (:pair <symbol> <object>)) <boolean>)}
    \begin{fielddesc}
      List of field names and values. Value \themefalse\ is used to
      represent an object that is not known compile time.
    \end{fielddesc}
  \end{field}
  \begin{field}
    \fieldname{x-prim-contents}
    \fieldtype{<object>}
    \begin{fielddesc}
      The contents of a primitive object. This field is \code{null} for
      nonprimitive objects.
    \end{fielddesc}
  \end{field}
  \begin{field}
    \fieldname{x-opt-contents}
    \fieldtype{<object>}
    \begin{fielddesc}
      This field is used to optimize list constants.
    \end{fielddesc}
  \end{field}
\end{class}

\begin{targetclass}
  \targetclassname{<object>}
  \targetclassinh
  \targetclassimm
  \targetclassnotebv
  \targetclassnofields
\end{targetclass}

\begin{targetclass}
  \targetclassname{<class>}
  \targetsuperclass{<object>}
  \targetclassinh
  \targetclassimm
  \targetclassnotebv
  \begin{targetfield}
    \targetfieldname{cl-superclass}
    \targetfieldtype{(:union <class> <null>)}
    \begin{targetfielddesc}
      The superclass of the class.
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{l-fields}
    \targetfieldtype{(:uniform-list <field>)}
    \begin{targetfielddesc}
      New fields defined in this class in addition to the superclass fields.
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{l-all-fields}
    \targetfieldtype{(:uniform-list <field>)}
    \begin{targetfielddesc}
      All fields of the class.
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{inheritable?}
    \targetfieldtype{<boolean>}
    \begin{targetfielddesc}
      \themetrue\ iff the class is inheritable
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{immutable?}
    \targetfieldtype{<boolean>}
    \begin{targetfielddesc}
      \themetrue\ iff the class is immutable
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{eq-by-value?}
    \targetfieldtype{<boolean>}
    \begin{targetfielddesc}
      \themetrue\ iff the class is equal by value
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{s-ctr-access}
    \targetfieldtype{<symbol>}
    \begin{targetfielddesc}
      Access to the constructor.
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{type-constructor}
    \targetfieldtype{(:maybe <type>)}
    \begin{targetfielddesc}
      The constructor type of the class. This field is computed
      from the fields defined by the class.
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{proc-constructor}
    \targetfieldtype{(:maybe <procedure>)}
    \begin{targetfielddesc}
      The constructor of the class.
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{goops?}
    \targetfieldtype{<boolean>}
    \begin{targetfielddesc}
      true iff the class is a GOOPS class
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{has-zero?}
    \targetfieldtype{<boolean>}
    \begin{targetfielddesc}
      true iff the class defines a zero value
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{zero-prim?}
    \targetfieldtype{<boolean>}
    \begin{targetfielddesc}
      true iff the class defines a zero value and it is a primitive value
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{x-zero-value}
    \targetfieldtype{<object>}
    \begin{targetfielddesc}
      A procedure computing the zero value, a primitive zero value,
      or null.
      This field is to be used
      internally by \theme.
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{module}
    \targetfieldtype{(:union (:uniform-list <symbol>) <symbol>)}
    \begin{targetfielddesc}
      The module where the class is defined. Value \code{'builtins}
      means a built-in class.
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{str-name}
    \targetfieldtype{<string>}
    \begin{targetfielddesc}
      the name of the class as a string
    \end{targetfielddesc}
  \end{targetfield}
\end{targetclass}

\begin{targetclass}
  \targetclassname{<param-class>}
  \targetsuperclass{<class>}
  \targetclassinh
  \targetclassmut
  \targetclassnotebv
  \begin{targetfield}
    \targetfieldname{i-params}
    \targetfieldtype{<integer>}
    \begin{targetfielddesc}
      number of type parameters for this parametrized class
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{l-tvars}
    \targetfieldtype{(:uniform-list <type-variable>)}
    \begin{targetfielddesc}
      type variables parametrizing this class
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{cl-instance-superclass}
    \targetfieldtype{<class>}
    \begin{targetfielddesc}
      the superclass of the instances of this parametrized class
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{l-instance-fields}
    \targetfieldtype{(:uniform-list <field>)}
    \begin{targetfielddesc}
      the fields defined by the instances of this parametrized class
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{l-instance-all-fields}
    \targetfieldtype{(:uniform-list <field>)}
    \begin{targetfielddesc}
      all the fields defined by the instances of this parametrized
      class and its superclasses
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{instances-inheritable?}
    \targetfieldtype{<boolean>}
    \begin{targetfielddesc}
      \themetrue\ iff the instances of this parametrized class are inheritable
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{instances-immutable?}
    \targetfieldtype{<boolean>}
    \begin{targetfielddesc}
      \themetrue\ iff the instances of this parametrized class are immutable
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{instances-eq-by-value?}
    \targetfieldtype{<boolean>}
    \begin{targetfielddesc}
      \themetrue\ iff the instances of this parametrized class are
      equal by value
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{instance-has-constructor?}
    \targetfieldtype{<boolean>}
    \begin{targetfielddesc}
      \themetrue\ iff the instances of this parametrized class have a
      constructor
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{s-instance-ctr-access}
    \targetfieldtype{<symbol>}
    \begin{targetfielddesc}
      Access to the constructors of the instances of this parametrized class.
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{instance-has-zero?}
    \targetfieldtype{<boolean>}
    \begin{targetfielddesc}
      True iff the instances of this parametrized class define a zero value.
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{proc-instance-zero}
    \targetfieldtype{(:maybe <procedure>)}
    \begin{targetfielddesc}
      A procedure to compute the zero values. This field is to be used
      internally by \theme.
    \end{targetfielddesc}
  \end{targetfield}
\end{targetclass}

\begin{targetclass}
  \targetclassname{<param-logical-type>}
  \targetsuperclass{<class>}
  \targetclassinh
  \targetclassmut
  \targetclassnotebv
  \begin{targetfield}
    \targetfieldname{i-params}
    \targetfieldtype{<integer>}
    \begin{targetfielddesc}
      number of type parameters for this parametrized class
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{l-tvars}
    \targetfieldtype{(:uniform-list <type-variable>)}
    \begin{targetfielddesc}
      type variables parametrizing this class
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{x-value-expr}
    \targetfieldtype{(:union <type> <type-variable> <singleton>)}
    \begin{targetfielddesc}
      the expression of this parametrized logical type
    \end{targetfielddesc}
  \end{targetfield}
\end{targetclass}

\begin{targetclass}
  \targetclassname{<param-procedure>}
  \targetsuperclass{<class>}
  \targetclassinh
  \targetclassmut
  \targetclassnotebv
  \begin{targetfield}
    \targetfieldname{i-first-number}
    \targetfieldtype{<integer>}
    \begin{targetfielddesc}
      the first location used by the type variables
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{i-nr-of-tvars}
    \targetfieldtype{<integer>}
    \begin{targetfielddesc}
      number of type variables in this class
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{l-tvars}
    \targetfieldtype{(:uniform-list <type-variable>)}
    \begin{targetfielddesc}
      type variables parametrizing this class
    \end{targetfielddesc}
  \end{targetfield}
  \begin{targetfield}
    \targetfieldname{type-contents}
    \targetfieldtype{(:union <type> <type-variable> <singleton>)}
    \begin{targetfielddesc}
      the type of the instances of this parametrized procedure
    \end{targetfielddesc}
  \end{targetfield}
\end{targetclass}

\end{document}
