\subsection{@}
\label{labconcat}
\noindent Name: \textbf{@}\\
\phantom{aaa}concatenates two lists or strings or applies a list as arguments to a procedure\\[0.2cm]
\noindent Library name:\\
\verb|   sollya_obj_t sollya_lib_concat(sollya_obj_t, sollya_obj_t)|\\[0.2cm]
\noindent Usage: 
\begin{center}
\emph{L1}\textbf{@}\emph{L2} : (\textsf{list}, \textsf{list}) $\rightarrow$ \textsf{list}\\
\emph{string1}\textbf{@}\emph{string2} : (\textsf{string}, \textsf{string}) $\rightarrow$ \textsf{string}\\
\emph{proc}\textbf{@}\emph{L1} : (\textsf{procedure}, \textsf{list}) $\rightarrow$ \textsf{any type}\\
\end{center}
Parameters: 
\begin{itemize}
\item \emph{L1} and \emph{L2} are two lists.
\item \emph{string1} and \emph{string2} are two strings.
\item \emph{proc} is a procedure or an external procedure.
\end{itemize}
\noindent Description: \begin{itemize}

\item In its first usage form, \textbf{@} concatenates two lists or strings.

\item In its second usage form, \textbf{@} applies the elements of a list as
   arguments to a procedure or an external procedure. In the case when \emph{proc} is
   a procedure or external procedure with a fixed number of arguments, a check
   is done if the number of elements in the list corresponds to the number of
   formal parameters of \emph{proc}. An empty list can therefore be applied only to a
   procedure that does not take any argument. In the case when \emph{proc} accepts an
   arbitrary number of arguments, no such check is performed.
\end{itemize}
\noindent Example 1: 
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> [|1,...,3|]@[|7,8,9|];
[|1, 2, 3, 7, 8, 9|]
\end{Verbatim}
\end{minipage}\end{center}
\noindent Example 2: 
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> "Hello "@"World!";
Hello World!
\end{Verbatim}
\end{minipage}\end{center}
\noindent Example 3: 
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> procedure cool(a,b,c) { 
  write(a,", ", b," and ",c," are cool guys.\n");
  };
> cool @ [| "Christoph", "Mioara", "Sylvain" |];
Christoph, Mioara and Sylvain are cool guys.
\end{Verbatim}
\end{minipage}\end{center}
\noindent Example 4: 
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> procedure sayhello() { 
  "Hello! how are you?";
  };
> sayhello();
Hello! how are you?
> sayhello @ [||];
Hello! how are you?
\end{Verbatim}
\end{minipage}\end{center}
\noindent Example 5: 
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> bashexecute("gcc -fPIC -Wall -c externalprocexample.c");
> bashexecute("gcc -fPIC -shared -o externalprocexample externalprocexample.o");

> externalproc(foo, "./externalprocexample", (integer, integer) -> integer);
> foo;
foo
> foo @ [|5, 6|];
11
\end{Verbatim}
\end{minipage}\end{center}
\noindent Example 6: 
\begin{center}\begin{minipage}{15cm}\begin{Verbatim}[frame=single]
> procedure add(L = ...) {
  var acc, i;
  acc = 0;
  for i in L do acc = i + acc;
  return acc;
  };
> add(1,2);
3
> add(1,2,3);
6
> add @ [|1, 2|];
3
> add @ [|1, 2, 3|];
6
> add @ [||];
0
\end{Verbatim}
\end{minipage}\end{center}
See also: \textbf{.:} (\ref{labprepend}), \textbf{:.} (\ref{labappend}), \textbf{procedure} (\ref{labprocedure}), \textbf{externalproc} (\ref{labexternalproc}), \textbf{proc} (\ref{labproc}), \textbf{bind} (\ref{labbind}), \textbf{getbacktrace} (\ref{labgetbacktrace})
