I'm not sure how to do this...
function f1()
{
var x = 10;
function f2(fx)
{
var x;
x = 6;
fx();
};
function f3()
{
print x;
};
f2(f3);
};
For each of the following two binding methods, what would the program print? A) Shallow Binding B) Deep Binding
Thanks for the help!
10
as the binding ofx
takes place whenf2
is called, shallow binding prints6
asx
is bound whenf3
(being a procedure parameter tof2
) is called fromf2
. – Lice