Question: Question 6 (6+7+7=20 points ) Consider the following program from a made up language gameG that uses pass-by-name parameter passing: 123456functionexchange(a,b)vart=astarta=bb=tend a) (6pt) What scoping

Question 6 (6+7+7=20 points ) Consider the following program from a made up language "gameG" that uses pass-by-name parameter passing: 123456functionexchange(a,b)vart=astarta=bb=tend a) (6pt) What scoping (dynamic or static) should "gameG" use? Why? In whose environment (caller or callee) who would we want the arguments to be evaluated? b) (7pt) A programmer wants to use the call exchange on existing variables s and t. Will they face any problems when calling exchange(s,t), if yes, how to solve it? c) (7pt) The same programmer tries to call exchange( i,o[i]), where o is an array. Will that be a problem? If yes, how to solve it? Will a call to exchange(o[i], i) have the same
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
