✓
Passing This code compiles and runs correctly.
Code
// MIRROR of 690_076_store_indexed_field_read_in_stored: two stores, an indexed
// field read in a `stored` RHS, and a `std/store:query` readback, all inside an
// imported module.
//
// The indexed read has to lower to the SoA column of a store whose home is the
// module, and the query arm has to bind against it — two synthesized names that
// must agree on the same namespace. Split across two exported tors because a
// subflow body is one flow; the entry chains them.
import app/lib
app/lib:run() |> app/lib:show()
Supporting Files
//
// `ui.sel` HOLDS A HANDLE, not a row position — ruled 2026-08-02. It was the
// literal 0 until then, which only addressed a row because the handle-validity
// wall was off for the first store declared (690_242). Position is not identity
// (O10.iii): a take swap-removes the last row into the freed slot, so an offset
// names a different row afterwards while a handle names the same one or traps.
// The handle comes from `| row`, the only place one is minted.
import std/io
import std/store
std/store:new(todos, capacity: 8) { done: i64 }
std/store:new(ui) { sel: -1[i64] }
pub tor run {}
run = std/store:insert(todos) { done: 0 }
| row r |> std/store:stored { ui.sel: r }
|> std/store:stored { todos[ui.sel].done: 1 - todos[ui.sel].done }
pub tor show {}
show = std/store:query(todos)
! query e |> std/io:print.ln("done {{ e.done:d }}")
Actual
done 1
Expected output
done 1
Flows
flow ~run click a branch to expand · @labels scroll to their anchor
run
Test Configuration
MUST_RUN