1.2.16. test/regress/rt-1.01.16

more generic stuff
Start felix section to test/regress/rt-1.01.16-0.flx[1 /1 ]
     1: #line 683 "./lpsrc/flx_regress.pak"
     2: //Check polymorphism
     3: #import <flx.flxh>
     4: open List;
     5: 
     6: fun snd(x,y)=>y;
     7: fun fst(x,y)=>x;
     8: 
     9: fun index[t] (l:list[t]) = {
    10:   fun f(il:int * list [int * t]) (e: t) =>
    11:     match il with
    12:     | ?i,?l => i+1, Cons ((i, e),l)
    13:     endmatch
    14:   ;
    15:   return
    16:     rev (snd ( fold_left
    17:       f of (int * list[int *t])
    18:       (0, Empty[int * t])
    19:       l
    20:     ))
    21:   ;
    22: }
    23: 
    24: var x = Empty[int];
    25: x = Cons(11,x);
    26: x = Cons(22,x);
    27: x = Cons(33,x);
    28: x = Cons(44,x);
    29: x = Cons(55,x);
    30: x = Cons(66,x);
    31: 
    32: val z = index x;
    33: iter
    34:   (proc (x:int,y:int)
    35:     {
    36:       print x; print " -> "; print y; endl;
    37:     }
    38:   )
    39:   z
    40: ;
End felix section to test/regress/rt-1.01.16-0.flx[1]
Start data section to test/regress/rt-1.01.16-0.expect[1 /1 ]
     1: 0 -> 66
     2: 1 -> 55
     3: 2 -> 44
     4: 3 -> 33
     5: 4 -> 22
     6: 5 -> 11
End data section to test/regress/rt-1.01.16-0.expect[1]