v_function.Rd
v_function
transpiles the supplied v
code to C
, compiles it,
and returns a R function that calls the compiled code.
Rcpp::cppFunction
, but for v
.
v_function(code, verbose = FALSE)
character
v code that defines the v function.
if TRUE
the compilation parameters will be shown.
R function that will call the compiled code
Note: R specific classes in v
can be found in the r
module.
if (FALSE) {
# create a compiled function with v code
f <- v_function("fn add_one(i int) int {
return i + 1
}")
# and use it in R
add_one(2)
}