- Peek as expression block (last expression is the value)
```nyash
static box Main {
main(args) {
local d = "1"
// Each arm can be a block; the last expression becomes the value
local dv = peek d {
"0" => { print("found zero") 0 }
"1" => { print("found one") 1 }
else => { print("other") 0 }
}
return dv
}
}
```
must_use Notes
- Peek arms are expressions. When using a block arm `{ ... }`, the last expression is the resulting value; statements without a final expression yield no usable value.
- Ternary is an expression; ensure both branches are type-compatible at MIR level (e.g., both yield integer or both yield string handle in current phase).