File: head.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 (30 lines) | stat: -rw-r--r-- 876 bytes parent folder | download | duplicates (3)
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
\subsection{head}
\label{labhead}
\noindent Name: \textbf{head}\\
\phantom{aaa}gives the first element of a list.\\[0.2cm]
\noindent Library name:\\
\verb|   sollya_obj_t sollya_lib_head(sollya_obj_t)|\\[0.2cm]
\noindent Usage: 
\begin{center}
\textbf{head}(\emph{L}) : \textsf{list} $\rightarrow$ \textsf{any type}\\
\end{center}
Parameters: 
\begin{itemize}
\item \emph{L} is a list.
\end{itemize}
\noindent Description: \begin{itemize}

\item \textbf{head}(\emph{L}) returns the first element of the list \emph{L}. It is equivalent
   to L[0].

\item If \emph{L} is empty, the command will fail with an error.
\end{itemize}
\noindent Example 1: 
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> head([|1,2,3|]);
1
> head([|1,2...|]);
1
\end{Verbatim}
\end{minipage}\end{center}
See also: \textbf{tail} (\ref{labtail}), \textbf{revert} (\ref{labrevert})