File: fullparentheses.tex

package info (click to toggle)
sollya 8.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 17,540 kB
  • sloc: ansic: 124,655; yacc: 7,543; lex: 2,440; makefile: 888; cpp: 77
file content (48 lines) | stat: -rw-r--r-- 2,255 bytes parent folder | download | duplicates (4)
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
\subsection{fullparentheses}
\label{labfullparentheses}
\noindent Name: \textbf{fullparentheses}\\
\phantom{aaa}activates, deactivates or inspects the state variable controlling output with full parenthesising\\[0.2cm]
\noindent Library names:\\
\verb|   void sollya_lib_set_fullparentheses_and_print(sollya_obj_t);|\\
\verb|   void sollya_lib_set_fullparentheses(sollya_obj_t);|\\
\verb|   sollya_obj_t sollya_lib_get_fullparentheses();|\\[0.2cm]
\noindent Usage: 
\begin{center}
\textbf{fullparentheses} = \emph{activation value} : \textsf{on$|$off} $\rightarrow$ \textsf{void}\\
\textbf{fullparentheses} = \emph{activation value} ! : \textsf{on$|$off} $\rightarrow$ \textsf{void}\\
\end{center}
Parameters: 
\begin{itemize}
\item \emph{activation value} represents \textbf{on} or \textbf{off}, i.e. activation or deactivation
\end{itemize}
\noindent Description: \begin{itemize}

\item An assignment \textbf{fullparentheses} = \emph{activation value}, where \emph{activation value}
   is one of \textbf{on} or \textbf{off}, activates respectively deactivates the output
   of expressions with full parenthesising. In full parenthesising mode,
   \sollya commands like \textbf{print}, \textbf{write} and the implicit command when an
   expression is given at the prompt will output expressions with
   parenthesising at all places where it is necessary for expressions
   containing infix operators to be parsed back with the same
   result. Otherwise parentheses around associative operators are
   omitted.
    
   If the assignment \textbf{fullparentheses} = \emph{activation value} is followed by an
   exclamation mark, no message indicating the new state is
   displayed. Otherwise the user is informed of the new state of the
   global mode by an indication.
\end{itemize}
\noindent Example 1: 
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> autosimplify = off!;
> fullparentheses = off;
Full parentheses mode has been deactivated.
> print(1 + 2 + 3);
1 + 2 + 3
> fullparentheses = on;
Full parentheses mode has been activated.
> print(1 + 2 + 3);
(1 + 2) + 3
\end{Verbatim}
\end{minipage}\end{center}
See also: \textbf{print} (\ref{labprint}), \textbf{write} (\ref{labwrite}), \textbf{autosimplify} (\ref{labautosimplify})