% Generated by roxygen2: do not edit by hand % Please edit documentation in R/function.R \name{ts_function} \alias{ts_function} \title{TS function definition} \usage{ ts_function(f, ..., result = ts_void()) } \arguments{ \item{f}{an R function} \item{...}{argument definitions (only required if f does not specify these in its formals)} \item{result}{return type (ignored if overloads are provided)} } \value{ a ts function object which has a \code{call} method that will call the function with the given arguments, which will be checked for type correctness. } \description{ TS function definition } \details{ Defining functions is the core of writing Rserve apps. Functions are referred to as \emph{object capabilities} (ocaps), as they are 'objects' that allow Javascript to access capabilities of R with a restricted interface. Only arguments can be adjusted. TS functions can be defined using existing (named) or anonymous functions. Anonymous functions are useful in that the arguments to the functions can explicitly be defined with their types as formal arguments: \if{html}{\out{