✓
Passing This code compiles and runs correctly.
Code
// MIRROR of 390_040_self_basic: `std/kernel:shape` as a module declaration with
// `kernel:init` feeding `kernel:self` through continuations.
//
// 115_005 pins kernel's init on the boundary in isolation; this pins the shape
// the library is actually written for, so a fix that only satisfies the bare
// init does not read as complete. The init opens a source block on the
// subflow-definition line — legal since 210_168, and this mirror could not be
// written at all before that.
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 },
{ mass: 3.0 },
}
| kernel k |> std/kernel:self { k.mass *= 2.0 }
| computed c |> std/io:print.blk {
mass[0]={{ c[0].mass:f }} mass[1]={{ c[1].mass:f }} mass[2]={{ c[2].mass:f }}
}
Actual
mass[0]=2 mass[1]=4 mass[2]=6
Expected output
mass[0]=2 mass[1]=4 mass[2]=6
Flows
flow ~run click a branch to expand · @labels scroll to their anchor
run
Test Configuration
MUST_RUN