003 stdlib if scoped

✓ Passing This code compiles and runs correctly.

Code

// Test: ~if with outer scope bindings
// Verifies that ~if works when:
// 1. It's in a pipeline (not top-level)
// 2. The condition references a continuation binding

~import "$std/io"

const std = @import("std");

// Event that returns a value we can check
~event get_value {}
| result { value: i32 }

~proc get_value {
    return .{ .result = .{ .value = 42 } };
}

// Test: ~if in pipeline, condition uses binding from outer continuation
~get_value()
| result r |> if(r.value > 10)
    | then |> std.io:println(text: "Value is greater than 10")
    | else |> std.io:println(text: "Value is 10 or less")
input.kz

Expected Output

Value is greater than 10

Test Configuration

MUST_RUN