source-academy / cs1101s

1 stars 0 forks source link

In environment model, what will the anonymous lambda expression point to? #16

Open mrqorib opened 4 years ago

mrqorib commented 4 years ago

Question: During function application, if the argument of the function is a lambda expression, what will the anonymous lambda expression point to? Is it pointing to the program frame or the frame consisting binding of parameter? Piazza: https://piazza.com/class/kas136yscf8605?cid=575

mrqorib commented 4 years ago

Answer: The resulting function object will point to the frame in which the lambda expression was evaluated in, because the function sub-expression and argument sub-expressions are evaluated first before the function is applied to the arguments.