2.11. Pattern Matching Tuples

It is also possible to pattern match tuples. Here is an example:
Start felix section to tut/tutorial/tut-1.11-0.flx[1 /1 ]
     1: #line 623 "./lpsrc/flx_tutorial.pak"
     2: #import <flx.flxh>
     3: val v = 1,2,(3,4);
     4: match (v) with
     5:   | (?x,_,?z) =>
     6:   {
     7:     print x;
     8:     print ", ";
     9:     match (z) with
    10:       | (?a,?b) =>
    11:       {
    12:         print "(";
    13:         print a;
    14:         print ", ";
    15:         print b;
    16:         print ")";
    17:       }
    18:     endmatch;
    19:   }
    20: endmatch;
    21: endl;
End felix section to tut/tutorial/tut-1.11-0.flx[1]
Start data section to tut/tutorial/tut-1.11-0.expect[1 /1 ]
     1: 1, (3, 4)
End data section to tut/tutorial/tut-1.11-0.expect[1]
Notice the use of the special pattern '_', which matches something without naming it. The ?x designation in a pattern introduces a variable.