Repository navigation
-mm=own: list walks from a const head and through lending calls; closures calling closures (TSLANG 235, cabLimb) - #1132
Merged
Conversation
…all that lends its argument back; a closure may call another closure of the same frame (TSLANG 235, cabLimb) - A `let` that only borrows may be given a named const's value (`const a = new L(0); for (let q: L | null = a; q; q = q.next)`): each assignment borrows the const, bounded by its release and by anything that takes it (borrowedByLocalLets). A const moved, cut or cleared while the walk reads it stays refused. - A walk stepping through `nn(q).next` no longer counts rc's release of the call's temporary as a keep of what the `let` holds. - A closure reading a closure it captured out of its own box calls it; a captured closure that does not escape counts as a fresh fill, so `cap` running `frame` then `ring` (golden_line_cab) compiles. A closure that escapes still takes its captures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the open own items of TSLANG_ISSUES.md: 235 under -mm=own (linked-list cursor walks) and cabLimb (closures in golden_line_cab.ts that call each other). 241 does not reproduce: the own facts come out the same in every compile order.
Walks (TSLANG 235)
letthat only borrows may be given a named const's value (const a = new L(0); for (let q: L | null = a; q; q = q.next)). The borrow is bounded by the const's release and by anything that takes the const (borrowedByLocalLets). This applies only to a named const's value; a read of a local's slot is still decided by the slot's receivers.q = nn(q).next): rc's release of the call's temporary is no longer a keep of what the walkingletholds. This only applies tolets that only borrow and are assigned again, soown_err_result_borrows_argumentis still refused.Closures calling closures (cabLimb)
followClosurefollows a closure stored into another closure's box.Tests
own_closure_calls_closure, and00tslang_issue_235_own(gc/rc/own, jit + compile).own_err_closure_calls_closure_returned/_stored, andown_err_walk_const_head_cut/_cleared/_moved.docs/own-memory-model.md: two sentences, one on walks and one on closures.Verified
--deepand--classes: 300 programs each, 0 failures.🤖 Generated with Claude Code