Closed Luna-Klatzer closed 1 month ago
Implement function calls from function references (variable-bound functions), which allow the user to store functions and then call them up again when needed.
For example:
Storing scope-bound functions:
def add(a: num, b: num) -> num { return a + b; } const locAdd = add; locAdd(1, 2); // -> 3
const subt = (a: num, b: num): num -> a - b; subt(1, 2); // -> -1
Implemented by #681.
Is there an existing proposal for this?
This feature does not exist in the latest version
Proposal
Implement function calls from function references (variable-bound functions), which allow the user to store functions and then call them up again when needed.
For example:
Storing scope-bound functions:
Exact behaviour / changes you want