When an identity test hides an error

A programmer proposes the replacement below. The intended CPS result is k(add_seven(x)). Assume x is any integer and k is a pure function that terminates and returns an integer for every integer input. Which statements are true? Select all that apply.


Python
def add_seven(x):
    return x + 7

def proposed_cps(x, k):
    return k(x) + 7
Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Continuation Passing Style Questions: