✓
Passing This code compiles and runs correctly.
Code
// PINS: two modules arming `std/store:query` on the SAME store at the SAME
// source line must mint distinct synthesized units. Query/sweep structs land
// in the STORE's home scope (sim), so a name keyed on store+line alone
// collides the moment a second file arms `items` on the same line — both
// files here carry their `! query` arm on line 14.
import std/io
import sim
import ext
sim:seed() |> sim:dump-sim() |> ext:dump-ext()
Supporting Files
// A second module arming a query on sim's `items` store. Its `! query` arm
// sits on line 14 — the same source line as sim/index.k's arm — so the
// synthesized sweep names must carry the arming file's identity, not only
// store+line.
import std/io
import std/store
import sim
// No store here — the `items` backing lives in sim's module struct.
//
// The arm below sits on line 14 — sim/index.k's arm sits on line 14 too.
pub tor dump-ext { }
dump-ext = std/store:query(items)
! query e |> std/io:print.ln("ext {{ e.v:d }}")
// The store owner: every synthesized unit minted for `items` emits into this
// module's struct, no matter which file armed the query.
import std/io
import std/store
std/store:new(items, capacity: 8) { v: i64 }
pub tor seed { }
seed = std/store:insert(items) { v: 10 } |> std/store:insert(items) { v: 20 }
// The arm below sits on line 14 — ext/index.k's arm sits on line 14 too.
pub tor dump-sim { }
dump-sim = std/store:query(items)
! query e |> std/io:print.ln("sim {{ e.v:d }}")
Actual
sim 10
sim 20
ext 10
ext 20
Expected output
sim 10
sim 20
ext 10
ext 20
Flows
flow ~seed click a branch to expand · @labels scroll to their anchor
seed
Test Configuration
MUST_RUN
koru.json:
{
"paths": {
"std": "../../../../../koru_std",
"sim": "./sim",
"ext": "./ext"
}
}