Fix precedence bugs, test on homework
This commit is contained in:
16
Project-02-03/triplaprograms/homework.tripla
Normal file
16
Project-02-03/triplaprograms/homework.tripla
Normal file
@@ -0,0 +1,16 @@
|
||||
let f(x, y) {
|
||||
if (x == 0) then
|
||||
let g(x, z) {
|
||||
x * y + z
|
||||
} in g(2 * y, x)
|
||||
else
|
||||
x + 1
|
||||
}
|
||||
g (a, i) {
|
||||
while (i > 0) do {
|
||||
a = a * f(a, i);
|
||||
i = i - 1
|
||||
};
|
||||
a + 42
|
||||
}
|
||||
in f (1, 2); g(3, 3)
|
||||
Reference in New Issue
Block a user