1: #line 507 "./lpsrc/flx_tutorial.pak"
2:
3: open Long;
4:
5: typedef three = unit + unit + unit;
6: typedef four = 4;
7: typedef nu = int + double + long;
8:
9:
10: val x1 = case 0 of (1+1+1);
11: val x2 = case 1 of 3;
12:
13: proc g(x:three) {
14: print "Case ";
15: match x with
16: | case 0 => { print 0; }
17: | case 1 => { print 1; }
18: | case 2 => { print 2; }
19: endmatch;
20: print " of three\n";
21: }
22:
23: g x1;
24: g x2;
25: g (case 2 of three);
26:
27: proc f(x:nu) {
28: match x with
29: | case 0 ?z => { print "case 0 "; print z; }
30: | case 1 ?z => { print "case 1 "; print z; }
31: | case 2 ?z => { print "case 2 "; print z; }
32: endmatch;
33: print "\n";
34: }
35:
36: val i1 = (case 0 of nu) 33;
37: val i2 = (case 1 of nu) 3.3;
38: val i3 = (case 2 of nu) 33L;
39: f i1;
40: f i2;
41: f i3;
42:
43: