Skip to content

[From PR #945] Remove dead closure_turn_history parameter threading in closure_to_fun #946

@claude

Description

@claude

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:

  1. Rename the destructured binding at line 355 to _closure_turn_history
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    from-pr-reviewIssue created from PR review feedbackquick-fixTrivial fix, batched by batch-fix workflow

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions