peon/tests/chainedCalls.pn

27 lines
372 B
Plaintext
Raw Normal View History

import std;
fn first(a, b, c: int): int {
2022-06-14 22:45:41 +02:00
return a;
}
fn second(a, b: int): int {
return b;
}
fn last(a, b, c: int): int {
return c;
2022-06-14 22:45:41 +02:00
}
fn middle(a, b, c: int): int {
return last(a, c, b);
2022-06-14 22:45:41 +02:00
}
print(first(1, 2, 3) == 1);
var x = first(second(1, 2), 3, 4);
print(x == 2);
print(middle(3, 1, 2) == 1);
print(first(last(second(2, 1), 3, 0), 4, 5) == 0);