Certain languages like lisp have the ability to return


Certain languages. like Lisp, have the ability to return newly created procedures at run time. In Fig.7.56. all functions, whether defined in the source text or created at run time, take at most one argument and return one value, either a function or a real. The operator 0 stands for composition of functions; that is (fog)( x) ::= f (g (x) ) .

a) What value is printed by main?

*b) Suppose that whenever a procedure is created and returned, its activation record becomes a child of the activation record of the function returning p. The passing environment of can then be maintained by keeping a tree of activation records rather than a stack. What is the tree of activation records when is computed by main in Fig. 7.56?

*c) Alternatively. suppose an activation record for is created when is activated , and made a child of the activation record for the procedure calling p, This approach can be used to maintain the activation environment for p. Draw snapshots of the activation records and their parent-child relationships as the statements in main are executed is s a stack sufficient to hold activation records when this approach is used?

Request for Solution File

Ask an Expert for Answer!!
Finance Basics: Certain languages like lisp have the ability to return
Reference No:- TGS01477014

Expected delivery within 24 Hours