Next: Type Oblivious Interfaces, Previous: Referable Objects, Up: Interpreters And This Library [Index]
Higher-order functions receive or return (references to) functions. Function references are sometimes here identified as function pointers. They are not pointers in the C sense of memory addresses, but do much behave like C function pointers. Their semantics are similar, even the declarations are C styled.
A function pointer is declared as:
type ‘(*’ name ‘)’ ‘(’ list of arguments ‘)’
same as in C. One such function pointer may refer a function declared as:
type name ‘(’ list of arguments ‘)’
Like in C, one function returning a function pointer matching the type of the previous declared function pointer is declared as:
type ‘(*’ function name ‘(’ function list of arguments ‘)’ ‘)’ ‘(’ list of arguments ‘)’