Global variables
The FunC program is essentially a list of function declarations/definitions and global variable declarations. This section covers the second topic.
A global variable can be declared with the global
keyword followed by the variable type and the variable name. For example,
global ((int, int) -> int) op;
int check_assoc(int a, int b, int c) {
return op(op(a, b), c) == op(a, op(b, c));
}
int main() {
op = _+_;
return check_assoc(2, 3, 9);
}