1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
\subsection{dieonerrormode}
\label{labdieonerrormode}
\noindent Name: \textbf{dieonerrormode}\\
\phantom{aaa}global variable controlling if \sollya is exited on an error or not.\\[0.2cm]
\noindent Library names:\\
\verb| void sollya_lib_set_dieonerrormode_and_print(sollya_obj_t)|\\
\verb| void sollya_lib_set_dieonerrormode(sollya_obj_t)|\\
\verb| sollya_obj_t sollya_lib_get_dieonerrormode()|\\[0.2cm]
\noindent Usage:
\begin{center}
\textbf{dieonerrormode} = \emph{activation value} : \textsf{on$|$off} $\rightarrow$ \textsf{void}\\
\textbf{dieonerrormode} = \emph{activation value} ! : \textsf{on$|$off} $\rightarrow$ \textsf{void}\\
\textbf{dieonerrormode} : \textsf{on$|$off}\\
\end{center}
Parameters:
\begin{itemize}
\item \emph{activation value} controls if \sollya is exited on an error or not.
\end{itemize}
\noindent Description: \begin{itemize}
\item \textbf{dieonerrormode} is a global variable. When its value is \textbf{off}, which is the default,
\sollya will not exit on any syntax, typing, side-effect errors. These
errors will be caught by the tool, even if a memory might be leaked at
that point. On evaluation, the \textbf{error} special value will be produced.
\item When the value of the \textbf{dieonerrormode} variable is \textbf{on}, \sollya will exit
on any syntax, typing, side-effect errors. A warning message will
be printed in these cases at appropriate \textbf{verbosity} levels.
\end{itemize}
\noindent Example 1:
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> verbosity = 1!;
> dieonerrormode = off;
Die-on-error mode has been deactivated.
> for i from true to false do i + "Salut";
Warning: one of the arguments of the for loop does not evaluate to a constant.
The for loop will not be executed.
> exp(17);
Warning: rounding has happened. The value displayed is a faithful rounding to 16
5 bits of the true result.
Warning: For at least 1 of the constants displayed in decimal, rounding has happ
ened.
2.41549527535752982147754351803858238798675673527224e7
\end{Verbatim}
\end{minipage}\end{center}
\noindent Example 2:
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> verbosity = 1!;
> dieonerrormode = off!;
> 5 */ 4;
Warning: syntax error.
The last symbol read has been "/".
Will skip input until next semicolon after the unexpected token. May leak memory
.
exp(17);
Warning: rounding has happened. The value displayed is a faithful rounding to 16
5 bits of the true result.
Warning: For at least 1 of the constants displayed in decimal, rounding has happ
ened.
2.41549527535752982147754351803858238798675673527224e7
\end{Verbatim}
\end{minipage}\end{center}
\noindent Example 3:
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> verbosity = 1!;
> dieonerrormode;
off
> dieonerrormode = on!;
> dieonerrormode;
on
> for i from true to false do i + "Salut";
Warning: one of the arguments of the for loop does not evaluate to a constant.
The for loop will not be executed.
Warning: some syntax, typing or side-effect error has occurred.
As the die-on-error mode is activated, the tool will be exited.
\end{Verbatim}
\end{minipage}\end{center}
\noindent Example 4:
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> verbosity = 1!;
> dieonerrormode = on!;
> 5 */ 4;
Warning: syntax error.
The last symbol read has been "/".
Will skip input until next semicolon after the unexpected token. May leak memory
.
Warning: some syntax, typing or side-effect error has occurred.
As the die-on-error mode is activated, the tool will be exited.
\end{Verbatim}
\end{minipage}\end{center}
\noindent Example 5:
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> verbosity = 0!;
> dieonerrormode = on!;
> 5 */ 4;
\end{Verbatim}
\end{minipage}\end{center}
See also: \textbf{on} (\ref{labon}), \textbf{off} (\ref{laboff}), \textbf{verbosity} (\ref{labverbosity}), \textbf{error} (\ref{laberror})
|