814
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
1 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
2 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
3 |
def add(x, y) =
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
4 |
if x == 0 then y else 1 + (add(x - 1, y));
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
5 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
6 |
def addT(x, y) =
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
7 |
if x == 0 then y else addT(x - 1, y + 1);
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
8 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
9 |
(write(add(1000, 1000)); addT(100000,100000))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
10 |
|