Question: Like Haskell, Python has higher-order functions. Unlike Haskell, Python uses a strict evaluation strategy. For this question, imagine that Python uses lazy evaluation. Consider these
Like Haskell, Python has higher-order functions. Unlike Haskell, Python uses a strict evaluation strategy. For this question, imagine that Python uses lazy evaluation. Consider these function definitions def f(a, b) : return b def g(h): return h(h) For each of the following expressions, assuming Python uses lazy evaluation, choose whether the expression terminates or diverges (i.e., loops forever) and briefly describe why. print( f(g, 3)) terminates diverges
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
