✓
Passing This code compiles and runs correctly.
Code
// A guarded watch on a PLURAL store: writing the guard field must
// re-announce the watched field on EVERY live row — plural
// `__store_announce_<T>` takes `(row, field)` and a foreign write names
// no row, so the step fans out through a synthesized per-row sweep.
// The singleton shape is 690_013; this pins the plural fan-out.
import std/io
import std/store
std/store:new(board) { alarm: 0[i64] }
std/store:new(sentries, capacity: 4) { post: i64 }
std/store:watch(sentries)
! post p when board.alarm == 1 |> std/io:print.ln("post {{ p:d }} sounds")
std/store:insert(sentries) { post: 7 }
| row _ |> _
| full |> _
std/store:insert(sentries) { post: 9 }
| row _ |> _
| full |> _
std/store:stored { board.alarm: 1 }
std/store:stored { board.alarm: 0 }
std/store:stored { board.alarm: 1 }
Actual
post 7 sounds
post 9 sounds
post 7 sounds
post 9 sounds
Expected output
✓ Zig✓ JavaScriptpost 7 sounds
post 9 sounds
post 7 sounds
post 9 sounds
Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (board, source: alarm: 0[i64])
flow ~new click a branch to expand · @labels scroll to their anchor
new (sentries, capacity: 4, source: post: i64)
flow ~watch click a branch to expand · @labels scroll to their anchor
watch (sentries)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (sentries, source: post: 7)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (sentries, source: post: 9)
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: board.alarm: 1)
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: board.alarm: 0)
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: board.alarm: 1)
Test Configuration
MUST_RUN LANGUAGES: zig js