Question: what happens when you evaluate function expression?
Piazza: https://piazza.com/class/kas136yscf8605?cid=930
Answer: A function application is made up of a function sub-expression and any number of argument sub-expressions. In order to evaluate a function application, you'll first need to evaluate those sub-expressions to get their values, before you can apply the value of the function sub-expression to the values of the argument sub-expressions.
For instance:
(() => x => 3)()(3): the function sub-exp is (() => x => 3)(), and the argument sub-exp is 3
a(3, 23, f(x => xx)(5)): the function expression is a, and the arg sub-exps are 3, 23, and f(x => xx)(5)
And so, function_expression simply returns the part of the tagged list that contains the function sub-expression (which is then evaluated to get the value of the sub-exp).
Question: what happens when you evaluate function expression? Piazza: https://piazza.com/class/kas136yscf8605?cid=930 Answer: A function application is made up of a function sub-expression and any number of argument sub-expressions. In order to evaluate a function application, you'll first need to evaluate those sub-expressions to get their values, before you can apply the value of the function sub-expression to the values of the argument sub-expressions.
For instance:
And so, function_expression simply returns the part of the tagged list that contains the function sub-expression (which is then evaluated to get the value of the sub-exp).