\section{RETALL Return From All Keyboard Sessions}

\subsection{Usage}

The \verb|retall| statement is used to return to the base workspace
from a nested \verb|keyboard| session.  It is equivalent to forcing
execution to return to the main prompt, regardless of the level
of nesting of \verb|keyboard| sessions, or which functions are 
running.  The syntax is simple
\begin{verbatim}
   retall
\end{verbatim}
The \verb|retall| is a convenient way to stop debugging.  In the
process of debugging a complex program or set of functions,
you may find yourself 5 function calls down into the program
only to discover the problem.  After fixing it, issueing
a \verb|retall| effectively forces FreeMat to exit your program
and return to the interactive prompt.
\subsection{Example}

Here we demonstrate an extreme example of \verb|retall|.  We
are debugging a recursive function \verb|self| to calculate the sum
of the first N integers.  When the function is called,
a \verb|keyboard| session is initiated after the function
has called itself N times.  At this \verb|keyboard| prompt,
we issue another call to \verb|self| and get another \verb|keyboard|
prompt, this time with a depth of 2.  A \verb|retall| statement
returns us to the top level without executing the remainder
of either the first or second call to \verb|self|:
\begin{verbatim}
    self.m
function y = self(n)
  if (n>1)
    y = n + self(n-1);
    printf('y is %d\n',y);
  else
    y = 1;
    printf('y is initialized to one\n');
    keyboard
  end
\end{verbatim}
\begin{verbatim}
--> self(4)
y is initialized to one
[self,8]--> self(6)
y is initialized to one
[self,8]--> retall
\end{verbatim}
