Skip to main content

FnCallHook

Type Alias FnCallHook 

Source
pub type FnCallHook = fn(name: &str, func: &Value, args: &[Value], caller_env: &Env, io: &mut IoContext) -> Result<Value, String>;
Expand description

Signature for the hook that executes named user-defined functions.

Registered once by exec::init() before the REPL loop starts. Called by eval_inner when a Value::Function is invoked. name is the function name (from the call site); caller_env is passed so the function body can access other user-defined functions (enabling recursion and mutual recursion).