✓
Passing This code compiles and runs correctly.
Code
// MIRROR of 390_021_multiline_source: `std/kernel:pairwise` over a module's own
// shape and init.
//
// Third kernel arm after 115_005 (bare init) and 115_016 (self). pairwise
// carries its body as a source block and expands to an O(n^2) form, so it
// exercises a different expansion than self does off the same init.
import app/lib
app/lib:run()
Supporting Files
import std/kernel
import std/io
std/kernel:shape(Body) {
mass: f64,
}
pub tor run {}
run = std/kernel:init(Body) {
{ mass: 1.0 },
{ mass: 2.0 },
}
| kernel k |> std/kernel:pairwise {
k.mass += k.other.mass
}
| computed c |> std/io:print.blk {
done, mass[0]={{ c[0].mass:f }}
}
Actual
done, mass[0]=3
Expected output
done, mass[0]=3
Flows
flow ~run click a branch to expand · @labels scroll to their anchor
run
Test Configuration
MUST_RUN