Problem
incant declarations are currently treated more like metadata/patterns than fully executable function values with call frames and lexical environments.
To support real computation (including recursion), incant execution semantics must be formalized.
Scope
- Implement executable
incant call model with:
- argument binding
- lexical scope handling
- return/yield propagation
- Support guarded recursive calls.
- Preserve behavior for current non-recursive examples.
Deliverables
- Runtime call-frame/environment mechanism for
incant calls.
- Tests for direct call, nested call, and recursion with base case.
- Developer notes describing recursion safety expectations.
Acceptance Criteria
- Recursive sample program executes correctly with deterministic result.
- Existing examples continue to run.
- Runtime remains stable under bounded recursion depth.
Validation Checklist
- Add recursion fixtures (e.g., factorial-like with base case).
- Add tests for parameter scoping and return behavior.
- Run full examples suite.
Non-goals
- Tail-call optimization.
- Full closure/lambda language surface.
- Advanced optimizer work.
Problem
incantdeclarations are currently treated more like metadata/patterns than fully executable function values with call frames and lexical environments.To support real computation (including recursion),
incantexecution semantics must be formalized.Scope
incantcall model with:Deliverables
incantcalls.Acceptance Criteria
Validation Checklist
Non-goals