✓
Passing This code compiles and runs correctly.
Code
// Test: per-call template with captured-argument substitution.
// `~count-to(n: 3)` captures `3` as the Expression text for `n`. The
// template interpolates `{{ n }}` into the Zig body. Each call site
// substitutes ITS captured value, so this is the foundation of macro-
// shaped events like `for`, `if`, etc.
const std = @import("std");
~pub event count-to { n: i32 }
~proc count-to|template|zig {
var i: i32 = 0;
while (i < {{ n }}) : (i += 1) {
std.debug.print("{d}\n", .{i});
}
}
~count-to(n: 3)
Actual
0
1
2
Expected output
0
1
2
Flows
flow ~count-to click a branch to expand · @labels scroll to their anchor
count-to (n: 3)
Test Configuration
MUST_RUN