Skip to main content

Module closure

Module closure 

Source
Expand description

Closures and their application (lean_apply_*, ported from apply.cpp).

m_fun of a closure is a Rust unsafe fn(Obj, ...) -> Obj with m_arity parameters cast to *const (). For an arity above LEAN_CLOSURE_MAX_ARGS it is an unsafe fn(*mut Obj) -> Obj receiving the arguments as an array, as in the C backend.

Constants§

LEAN_CLOSURE_MAX_ARGS
Largest arity whose function takes its arguments as separate parameters.

Functions§

lean_alloc_closure⚠
lean_apply_1⚠
Applies the closure f to the arguments; all of them are consumed.
lean_apply_2⚠
Applies the closure f to the arguments; all of them are consumed.
lean_apply_3⚠
Applies the closure f to the arguments; all of them are consumed.
lean_apply_4⚠
Applies the closure f to the arguments; all of them are consumed.
lean_apply_5⚠
Applies the closure f to the arguments; all of them are consumed.
lean_apply_6⚠
Applies the closure f to the arguments; all of them are consumed.
lean_apply_7⚠
Applies the closure f to the arguments; all of them are consumed.
lean_apply_8⚠
Applies the closure f to the arguments; all of them are consumed.
lean_apply_9⚠
Applies the closure f to the arguments; all of them are consumed.
lean_apply_10⚠
Applies the closure f to the arguments; all of them are consumed.
lean_apply_11⚠
Applies the closure f to the arguments; all of them are consumed.
lean_apply_12⚠
Applies the closure f to the arguments; all of them are consumed.
lean_apply_13⚠
Applies the closure f to the arguments; all of them are consumed.
lean_apply_14⚠
Applies the closure f to the arguments; all of them are consumed.
lean_apply_15⚠
Applies the closure f to the arguments; all of them are consumed.
lean_apply_16⚠
Applies the closure f to the arguments; all of them are consumed.
lean_apply_m⚠
lean_apply_m: application to more than 16 arguments.
lean_apply_n⚠
lean_apply_n.
lean_apply_slice⚠
Applies f (owned) to args (owned), as lean_apply_n in apply.cpp.
lean_closure_arity⚠
lean_closure_fun⚠
lean_closure_get⚠
lean_closure_num_fixed⚠
lean_closure_set⚠
lean_curry⚠
Calls the function f of a closure with all its args.len() arguments (curry in apply.cpp). The arguments are consumed.