TYCHO Search

Search documentation

    ↑ ↓ to move · Enter to open · Esc to close

    Subscript design notes (maintainers)

    Why the user-facing behavior in reference/subscripts.md is sound. Users don't need this page.

    Lowering

    A subscript is a compile-time place-macro: at a call site g.edge(i) is replaced by the yielded place with the arguments substituted (g.nodes[i]), and the surrounding read or write flows through the ordinary lvalue machinery. There is no runtime object. It generalizes the built-in &m[k] place to user code: a scoped, transient projection into part of a value — never a stored reference, never crossing the deep-copy thread boundary, needing no lifetime analysis. That is what fits it inside the arena + deep-copy model.

    Why each rule exists

    Value semantics

    Writing through a projection into a by-value parameter mutates that parameter's private copy, exactly like the spelled-out place. The usual mutability rules apply unchanged; the projection adds no new storage shape, only ergonomic traversal of the index-pool idiom.

    Decided 2026-10-18 (update probe)