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})
|