progs/fun/add.fun
changeset 814 1fbaa5f05516
equal deleted inserted replaced
813:059f970287d1 814:1fbaa5f05516
       
     1 
       
     2 
       
     3 def add(x, y) =
       
     4   if x == 0 then y else 1 + (add(x - 1, y));
       
     5 
       
     6 def addT(x, y) =
       
     7   if x == 0 then y else addT(x - 1, y + 1);
       
     8 
       
     9 (write(add(1000, 1000)); addT(100000,100000))
       
    10