Notes on the Midterm Exam: - Provided on the class website are the old exams, with accompanying study guides and comments, as well as a censored version of next week's exam. The midterm structure is provided, along with some helper functions that you will need to understand very well AHEAD OF TIME in order to complete some questions. Part 1: Higher-Order Functions Study the given functions and understand how they would be used to implement various applications. Part 2: Iterative processes Note that iteration here implies tail recusion. Understand how tail recursion works for the times_power example from class and in general. Part 3: Abstraction Barrier Here, make sure you understand very well the definition of multiset and how abstraction barrier concepts are implemented. Part 4: Number of Steps Note that for these questions providing your rationale isn't necessary if you feel confident about you answer. However, you might score some partial credit if you demonstrate some understanding and your answer is wrong. If you're not that great with determining the # of steps, notice that your options are limited in the statement of the problem, so can arrive at an answer by process of elimination. More on Testing Higher-Order Functions: - See DEMO - The identity_function is a good test since it is a transparent look in the computation of accumulate_list, as the application is as simple as it gets. If the application was complicated, possible problems in the implementation of it using accumulate_list would obscure possible troubles in accumulate_list itself. - The operation_journal function is also another good test. It shows the history of the computation steps, with the symbol 'empty representing the startval, and cons representing the operation. Note here that we are not concerned with the actual accumulation that occurs here, but displaying the general structure of the computation, as we can replace cons and 'empty with anything. - When writing a generic function, it is best to start with a concrete version, testing it, and then stepping down to the generic level. The reason being is that it is much easier to write and esp. test a concrete function than it is a generic one. - Next time: nested_accumulate_lr/rl for accumulating nested list structures.