Skip to main content

call_goal

Function call_goal 

Source
pub fn call_goal(m: &mut Machine, goal: Word) -> i32
Expand description

Dispatch a goal term: control constructs and deterministic builtins go through control::try_builtin; everything else is a registry lookup into compiled code. Also used by control continuations (and later by call/1 and findall/3).

Wraps the walk in a depth guard (#23): runtime-walked recursion that is not trampolined (control-construct metacalls, deep findall/3 or catch/3 recovery) fails with an uncatchable resource error instead of overflowing the native C stack. Compiled tail recursion reaches the callee via the resolve trampoline and never passes through here.