higherManyVars.wacc 298 Bytes
Newer Older
Jack Q's avatar
Jack Q committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# higher order functions with many variables

# Output:
# 6

# Exit:
# 0

# Program:

begin
  int g(int a, int b, int c) is
    return a + b + c
  end

  int{int, int, int} f(int{int, int, int} d) is
    return d
  end

  int{int, int, int} x = call f(g);
  int y = call x(2, 4, 0);
  println y
end