raz / conform / run / ExportedMatch.raz

21 lines · 388 B · raw · history · last change b38de572

1(* match on an exported variable: its names stand for the fields of a
2 copy, which the arm may change without changing the variable. *)
3module ExportedMatch;
4import Out, Shared;
5
6proc show;
7begin
8 match Shared.shape of
9 | dot: Out.str("dot");
10 | circle(r): r := r + 1; Out.int(r);
11 end;
12 Out.ln;
13end;
14
15proc main*;
16begin
17 show;
18 show;
19end;
20
21end ExportedMatch.