Add @match
utkarshkukreti opened this issue · comments
Utkarsh Kukreti commented
Test case:
@for x in &[(1, 2), (3, 3), (5, 4), (0, 1)] {
@match x {
(1, 2) => "1 -> 2\n",
(x, y) if x == y => { "eq" "\n" },
(x, y) if x == y + 1 => {
div { {x} {y} } "\n"
}
_ => "!\n"
}
}
Output:
1 -> 2
eq
<div>54</div>
!