005 user event binding

✓ Passing This code compiles and runs correctly.

Code

// TEST: kernel view binding can flow into an arbitrary user event
//
// Verifies:
// 1. kernel:init creates a view binding
// 2. user-defined events can consume values derived from that binding

~import "$std/kernel"
~import "$std/io"

~std.kernel:shape(Body) {
    mass: f64,
}

~event print_mass { value: f64 }
~proc print_mass {
    const std = @import("std");
    std.debug.print("mass={d}\n", .{value});
}

~std.kernel:init(Body) {
    { mass: 1.0 },
    { mass: 2.0 },
}
| kernel k |> print_mass(value: k.ptr[0].mass)

~std.io:print.ln("done")
input.kz

Expected Output

mass=1
done

Test Configuration

MUST_RUN