\Header{function}{Function Definition}
\alias{return}{function}
\keyword{programming}{function}
\begin{Usage}
\begin{verbatim}
function( arglist ) expr
return(value)
\end{verbatim}
\end{Usage}
\begin{Description}
These functions provide the base mechanisms for defining
new functions in the \R\ language.\end{Description}
\begin{SeeAlso}
\texttt{\Link{args}} and \texttt{\Link{body}} for accessing the arguments
and body of a function.
\texttt{\Link{debug}} for debugging; \texttt{\Link{invisible}} for
\texttt{return(.)}ing \emph{invisibly}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
norm <- function(x) sqrt(x%*%x)
norm(1:4)

## An anonymous function:
(function(x,y){ z <- x^2 + y^2; x+y+z })(0:7, 1)
\end{ExampleCode}
\end{Examples}

