✓
Passing This code compiles and runs correctly.
Code
// 690_051 — CAPACITY selects the store shape (the 690_050 ruling, positive
// pin). `capacity: N` (N > 1) at create declares the reactive CONTAINER —
// rows grow from empty; insert/query address them. The DEFAULT capacity 1
// declares the reactive VALUE — always present, direct `store.field` access
// through stored/watch. Initialization stays orthogonal: the value store
// seeds `count: 0[i64]` (a column default), the container declares bare
// `n: i64` — neither spelling selects the shape; only capacity does.
import std/io
import std/store
std/store:new(items, capacity: 8) { n: i64 }
std/store:query(items)
! query { entity.n } |> std/io:print.ln("item {{ n:d }}")
std/store:new(tally) { count: 0[i64] }
std/store:watch(tally)
! count c |> std/io:print.ln("count {{ c:d }}")
std/store:insert(items) { n: 1 }
std/store:insert(items) { n: 2 }
std/store:stored { tally.count: tally.count + 1 }
Actual
item 1
item 2
count 1
Expected output
item 1
item 2
count 1
Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: items, capacity: 8, source: n: i64)
flow ~query click a branch to expand · @labels scroll to their anchor
query (expr: items)
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: tally, source: count: 0[i64])
flow ~watch click a branch to expand · @labels scroll to their anchor
watch (expr: tally)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (expr: items, source: n: 1)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (expr: items, source: n: 2)
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: tally.count: tally.count + 1)
Test Configuration
MUST_RUN