Question: Deep and Shallow Binding Consider the following pseudocode, assuming dynamic scoping rules: 1 procedure main ( ) 2 x : int : = 3 3
Deep and Shallow Binding
Consider the following pseudocode, assuming dynamic scoping rules:
procedure main
x : int :
y : int :
procedure mult
x : x y
print x
procedure three f : procedure
x : int :
f
procedure two
y : int :
one three mult
procedure one f : procedure f : procedure
x : int :
f f
main body
two
print x
If the language uses deep binding, what will the output be Explain your answer.
If the language uses shallow binding, what will the output be Explain your answer.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
