1: include "std"; 2: fun f(x:int) => g(x-1); 3: fun g(x:int) => if x>0 then f(x-1) else 0 endif; 4: print (g 10); endl; 5:
1: include "std"; 2: union ilist = empty | cons of int * ilist; 3: var x = empty; 4: x = cons (1,x); 5: x = cons (2,x); 6: 7: proc print(x:ilist) { 8: match x with 9: | empty => {} 10: | cons (?h,?t) => { print h; print " "; print t; } 11: endmatch; 12: } 13: 14: print x; endl;