Problem
The evaluator function signatures thread 5 parameters across the codebase:
scope: &mut Scope
call_stack: &HashSet<String>
total_iterations: &mut u64
warnings: &mut Vec<String>
depth: usize
This parameter threading is error-prone and makes function signatures hard to read.
Solution
Bundle these into an EvalContext struct:
pub struct EvalContext {
scope: &mut Scope,
call_stack: &HashSet<String>,
total_iterations: &mut u64,
warnings: &mut Vec<String>,
depth: usize,
}
Pass &mut EvalContext to all evaluator functions.
Files
src/evaluator.rs — Create struct and refactor signature threading
Benefits
- Reduces function parameter count from 5+ to 1
- Clearer intent (all evaluator state grouped logically)
- Easier to add future context fields
- Improves readability of evaluator call sites
Acceptance Criteria
Related Tech Debt
This is independent of but complements the HashSet→Vec call_stack refactoring (RUST-2).
Co-Authored-By: Claude noreply@anthropic.com
Problem
The evaluator function signatures thread 5 parameters across the codebase:
scope: &mut Scopecall_stack: &HashSet<String>total_iterations: &mut u64warnings: &mut Vec<String>depth: usizeThis parameter threading is error-prone and makes function signatures hard to read.
Solution
Bundle these into an
EvalContextstruct:Pass
&mut EvalContextto all evaluator functions.Files
src/evaluator.rs— Create struct and refactor signature threadingBenefits
Acceptance Criteria
Related Tech Debt
This is independent of but complements the HashSet→Vec call_stack refactoring (RUST-2).
Co-Authored-By: Claude noreply@anthropic.com