Background
Identified during review of PR #945 (fix(lisp): prevent closure and HOF state leaks).
Issue
closure_to_fun in apply.ex:355-490 destructures closure_turn_history from the closure tuple and passes it through 8 call sites (lines 386, 400, 414, 428, 476, 490) to eval_closure_args. Since closures now always store [] for turn_history (per the PR fix), and eval_closure_args already ignores it via _closure_turn_history at line 593, this parameter is dead code.
Fix
Mechanical cleanup:
- Rename the destructured binding at line 355 to
_closure_turn_history
- Drop the parameter from
eval_closure_args entirely (remove from 8 call sites and the function head)
Complexity
Low — purely mechanical rename + parameter removal, no semantic change.
Background
Identified during review of PR #945 (fix(lisp): prevent closure and HOF state leaks).
Issue
closure_to_funinapply.ex:355-490destructuresclosure_turn_historyfrom the closure tuple and passes it through 8 call sites (lines 386, 400, 414, 428, 476, 490) toeval_closure_args. Since closures now always store[]for turn_history (per the PR fix), andeval_closure_argsalready ignores it via_closure_turn_historyat line 593, this parameter is dead code.Fix
Mechanical cleanup:
_closure_turn_historyeval_closure_argsentirely (remove from 8 call sites and the function head)Complexity
Low — purely mechanical rename + parameter removal, no semantic change.