You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

24 lines
961 B

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/swift-function.R
\name{swift_function}
\alias{swift_function}
\title{Define an R Function with a Swift Implementation}
\usage{
swift_function(code, cache_dir = tempdir())
}
\arguments{
\item{code}{Source code for the Swift function definition.}
\item{cache_dir}{Directory to use for caching shared libraries. The default
value of \code{\link[=tempdir]{tempdir()}} results in the cache being valid only for the current
R session. Pass an alternate directory to preserve the cache across R sessions.}
}
\description{
Dynamically define an R function with Swift source code. Compiles and links
a shard library with bindings to the Swift function then defines an R function
that uses \code{.Call} to invoke the library.
}
\note{
Remember that the function need to be \code{public} and that you need to put
the required \verb{@_cdecl ("…")} decorator before the function definition.
}