✓
Passing This code compiles and runs correctly.
Code
// PINS: a `! sweep` arm can WRITE the row it is standing on, not only read it.
//
// `query` already does this — 690_008 is
// `! query { entity.hp, … } when kind == 1 |> std/store:stored { entity.hp: … }`
// — and sweep is query's momentary, nestable twin. The same write in a sweep
// arm is refused, and the diagnostic reads the projection name as a store:
//
// std/store:stored: unknown store 'entity' - no std/store:new(entity) found
//
// Unguarded on purpose: a `when` guard on a sweep arm is accepted and silently
// ignored (690_084), so a guarded write would pass this test for the wrong
// reason. Each row writes a value derived from its OWN column, which is what
// proves the write lands on the row the arm is standing on.
//
// This is the difference between a store you can render and a store you can
// MAINTAIN from a running program. `query` is top-level-only by design — it is
// a standing rule fused into the write paths — so a nested body that has to
// update one row has no verb at all today: keyed addressing is unbuilt
// (690_018 is an ASPIRATION pin, spelling still provisional), and take+insert
// swap-removes, which shuffles the very row ordinals a renderer lays out by.
//
// Found writing koru-examples/downloads, where curl's `! progress pr` names
// WHICH transfer moved (`pr.index`) and the program wants to bump that row's
// percent. Three concurrent bars need it; one shared cell is not information.
//
// SIBLING GAP, not pinned here: a sweep body cannot reference the enclosing
// EVENT's parameters either — captures collects mid-chain binds (690_073) and
// not inputs — so the guard above reaches `target` while a body reaching `v`
// gets `use of undeclared identifier 'v'`.
import std/io
import std/store
std/store:new(rows, capacity: 8) { idx: i64, pct: 0[i64] }
std/store:insert(rows) { idx: 0, pct: 0 }
| row _ |> _
std/store:insert(rows) { idx: 1, pct: 0 }
| row _ |> _
std/store:sweep(rows)
! sweep e |> std/store:stored { e.pct: e.idx + 10 }
std/store:sweep(rows)
! sweep e |> std/io:print.ln("idx {{ e.idx:d }} pct {{ e.pct:d }}")
Actual
idx 0 pct 10
idx 1 pct 11
Expected output
idx 0 pct 10
idx 1 pct 11
Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: rows, capacity: 8, source: idx: i64, pct: 0[i64])
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (expr: rows, source: idx: 0, pct: 0)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (expr: rows, source: idx: 1, pct: 0)
flow ~sweep click a branch to expand · @labels scroll to their anchor
sweep (expr: rows)
flow ~sweep click a branch to expand · @labels scroll to their anchor
sweep (expr: rows)
Test Configuration
MUST_RUN