✓
Passing This code compiles and runs correctly.
Code
// TEST: kernel:pairwise with outer range expression
//
// pairwise(0..N) { body } |> per_step(...)
//
// Verifies:
// 1. The outer loop is generated by pairwise, not a separate ~for
// 2. The per-step continuation runs INSIDE the outer loop (N times, not 1)
// 3. Ergonomics: one less level of nesting vs for | each _ |> pairwise
~import "$std/kernel"
~import "$std/io"
~std.kernel:shape(Body) {
mass: f64,
}
~std.kernel:init(Body) {
{ mass: 1.0 },
{ mass: 2.0 },
}
| kernel k |>
std.kernel:pairwise(0..3) {
k.mass += k.other.mass
}
|> std.io:print.ln("step")
~std.io:print.ln("done")
Expected
step
step
step
done
Actual
step
step
step
done
Test Configuration
MUST_RUN