✓
Passing This code compiles and runs correctly.
Code
// std/store:sweep body must capture enclosing mid-pipe binds. The sweep loop
// is site-local (inline at the call site — where `: n` is in Zig scope), but
// the transplanted sweepbody was a separate event that only took projection
// fields. Referencing `n` inside `! sweep` leaked a raw host
// `undeclared identifier` — the flagship todo_tui hit this as `: body` (a
// Window from sub-fill) used inside the row paint. Momentary sweep runs HERE,
// so enclosing binds are in scope and must be threaded into the sweepbody.
import std/io
import std/store
pub tor make {} -> i64
proc make|zig {
return 7;
}
std/store:new(items, capacity: 4) { v: i64 }
std/store:insert(items) { v: 10 }
std/store:insert(items) { v: 20 }
make(): n |> for(0..1)
! each _ |> std/store:sweep(items)
! sweep { entity.v } |> std/io:print.ln("n {{ n:d }} v {{ v:d }}")
Actual
n 7 v 10
n 7 v 20
Expected output
n 7 v 10
n 7 v 20
Flows
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: items, capacity: 4, source: v: i64)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (expr: items, source: v: 10)
flow ~insert click a branch to expand · @labels scroll to their anchor
insert (expr: items, source: v: 20)
flow ~make click a branch to expand · @labels scroll to their anchor
make
Test Configuration
MUST_RUN