Conversation
letrec-values shares the let-values node and parser, distinguished by a Rec flag; its bindings are kept live on the environment stack while their expressions and the body evaluate, so clauses can refer to earlier and later bindings for (mutual) recursion. Free-variable analysis now also walks binding expressions, shadowing them for letrec but not for let.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #78 +/- ##
==========================================
+ Coverage 73.19% 74.41% +1.22%
==========================================
Files 24 24
Lines 2108 2146 +38
Branches 290 299 +9
==========================================
+ Hits 1543 1597 +54
+ Misses 565 549 -16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Cover the AnalysisFreeVars change with closures that enclose a let-values and a letrec-values whose binding expression captures a free variable, exercising the previously untested binding-expression traversal flagged by codecov on PR #78.
|
Regarding the Codecov patch-coverage report: the meaningful gap was the new Fixed in
The remaining uncovered lines are left intentionally: the |
Summary
letrec-values, whose bindings are in scope for both the binding expressions and the body (enabling recursion and mutual recursion), unlikelet-valueswhose expressions evaluate in the enclosing scope.letrec-valuesreuses the existingLetValuesAST node andparseLetValues, distinguished by a newRecflag; the parser accepts the already-lexedletrec-valueskeyword.letrec-valuesbut not forlet-values, so closures enclosing either form capture the correct variables.Fixes #8
Test plan
ctest --preset debug— 14 unit tests pass (adds aletrec-valueslexing test)nora-lit test/integration— 52 integration tests pass (adds 4letrec-values.rkttests: sequential binding, closure over a later binding, mutual reference, multiple-values clause)clang-format --dry-run --Werroron changed files — clean