Deep / shallow binding only makes sense when a procedure can be passed as an argument to a function.
- A deep binding binds the environment during the procedure as an argument.
- An incorrect binding binds the medium during a procedure that is actually called.
Deep binding.
Here f3 () gets the environment f1 () and prints the value x as 10, which is the local variable f1 ().
Invalid binding.
f3 () is called in f2 () and therefore gets the environment f2 () and prints the value x as 6, which is local to f2 ()
source share