Conversation
Added 11 tests covering: - Basic closure capture - 2-level and 3-level nesting - Closure use after creation - Type mismatch detection - times combinator integration All tests pass. No gaps found in closure nesting support. Key insight: The Quotation vs Closure distinction is by design: - Quotation = stateless, body effect matches declared effect - Closure = captures values, must be explicitly declared (except for strand.spawn pattern) The type system handles deep nesting, captures, and type mismatches correctly.
Added 10 tests covering: - times with quotation that pushes (correctly rejected) - times with valid stack-neutral quotation - while and until combinators - if branches with matching/mismatching effects - call with inline quotations - Quotation type preservation through words Result: Found 2 gaps (documented with "KNOWN GAP" comments): 1. while body [1] should be rejected but passes (row variable absorbs pushed value) 2. until cond [1] should be rejected but passes (Int not rejected when Bool expected) These gaps are worth a follow-up issue but don't block the test additions.
PR Review: Closure and Quotation Safety TestsThank you for this comprehensive test suite! This PR adds excellent coverage for closure nesting and quotation effect verification. Here's my detailed review: ✅ Strengths1. Excellent Test Coverage
2. Outstanding Documentation
3. Transparency About Known Gaps
4. Good Test Design Patterns
🔍 Code Quality ObservationsMinor: Test Complexity vs. BehaviorIn // : make-between ( Int Int -- Quot )
// [ dup rot i.>= swap rot i.<= and ] ;But the actual test body is simplified: body: vec\![Statement::WordCall {
name: "i.>=".to_string(),
span: None,
}],Recommendation: Either update the comment to match the simplified test or implement the full "between" logic. The current test still validates multi-capture handling, but the mismatch could confuse future maintainers. Minor: Assertion in
|
#230
#231