Module eval_function

Module eval_function 

Source
Expand description

Function evaluation module

This module handles all function-related operations in the interpreter. Provides function definition, calling, closure capture, and parameter binding. Extracted for maintainability and following Toyota Way principles. All functions maintain <10 cyclomatic complexity.

Structs§

Closure
Function closure with captured environment

Functions§

check_recursion_depth
Check recursion depth before entering function
create_partial_application
Create a partial application of a function
decrement_depth
Decrement recursion depth after exiting function
eval_function_call
Call a function with given arguments
eval_function_composition
Evaluate function composition (f ∘ g)
eval_function_def
Evaluate a function definition and return a closure
eval_lambda
Evaluate a lambda expression and return a closure
eval_method_call_value
Evaluate a method call on a value
get_arity
Get arity (number of parameters) of a callable value
get_current_depth
Get current recursion depth (for debugging/monitoring)
is_callable
Check if a value is callable (function, builtin, etc.)
set_max_recursion_depth
Set the maximum recursion depth limit