Question: Here's a code fragment in some generic language: varx = 3 ; function print ( x ) ; varx = x + 2 ; print
Here's a code fragment in some generic language:
varx;
function
printx;
varx;
printx;
;
Line
Line
Line
Line
Line
Line
Line
You are going to play the role of a language designer here. Assume static, nested scoping. For each of the following outputs, define precise rules that might lead to the given output. For example, if the output were then you would say "Variables come into scope after their declaration and before their declaration identifiers refer to whatever is already in scope."
a
NaN
b Error on line : is not declared
C
d
e Error on line : used in its own declaration
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
