Implemented function pointers as parameters

This commit is contained in:
2025-01-30 23:57:41 +01:00
parent 313302b9c8
commit dd6d1cc16c
5 changed files with 76 additions and 36 deletions

View File

@ -1,12 +1,12 @@
main() {
f(1, 2, 3, 4, 5, 6)
f1(1, 2, 3, 4, 5, 6)
}
f(a Int, b Int, c Int, d Int, e Int, f Int) {
g(f, e, d, c, b, a)
f1(a Int, b Int, c Int, d Int, e Int, f Int) {
f2(f, e, d, c, b, a)
}
g(a Int, b Int, c Int, d Int, e Int, f Int) {
f2(a Int, b Int, c Int, d Int, e Int, f Int) {
assert a == 6
assert b == 5
assert c == 4