Skip to contents

implemented_function(symfunc, implementation) returns an undefined function named after symfunc whose applications carry implementation, as SymPy's implemented_function(). lambdify() evaluates the applications with the implementation, and the code printers inline an implementation that is a Lambda().

Usage

implemented_function(symfunc, implementation)

Arguments

symfunc

A function name, or an undefined function made by Function().

implementation

A Lambda() or an R function.

Value

An undefined function (class sym_function).

Examples

x <- Symbol("x")
f <- implemented_function("f", Lambda(x, 2 * x))
ccode(f(x))
#> [1] "2*x"