Skip to main content

lexical_function_value

Function lexical_function_value 

Source
pub fn lexical_function_value(
    cx: &mut Cx,
    name: Symbol,
    env: LexicalEnv,
    body: Arc<dyn Fn(&mut Cx, &LexicalEnv, Vec<Value>) -> Result<Value> + Send + Sync + 'static>,
) -> Result<Value>
Expand description

Wraps a LexicalFunction as an opaque, callable runtime Value.

The kernel factory defines opaque-object construction; this helper packages a name, captured scope, and body into a callable value for the host eval.