1: #line 191 "./lpsrc/flx_tut_migrate.pak" 2: #import <flx.flxh> 3: fun f(x:int) => g(x-1); 4: fun g(x:int) => if x>0 then f(x-1) else 0 endif; 5: print (g 10); endl; 6:
1: #line 201 "./lpsrc/flx_tut_migrate.pak" 2: #import <flx.flxh> 3: union ilist = empty | cons of int * ilist; 4: var x = empty; 5: x = cons (1,x); 6: x = cons (2,x); 7: 8: proc xprint(x:ilist) { 9: match x with 10: | empty => {} 11: | cons (?h,?t) => { print h; print " "; xprint t; } 12: endmatch; 13: } 14: 15: xprint x; endl; 16: