Question: Problem 3 : Deep and Shallow Binding Consider the following pseudocode, assuming dynamic scoping rules: procedure main ( ) { x:int : = 2 y:
Problem : Deep and Shallow Binding
Consider the following pseudocode, assuming dynamic scoping rules:
procedure main
x:int :
y: int :
procedure incrementn:int
if n
x:x
y:y
incrementn
procedure decrementn:int
if n
x : x
y : y
decrementn
procedure two
y:int :
onedecrement increment,
procedure one:procedure, f:procedure, m:int
x:int :
fm
fm
two
printx
printy
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
