Lab 13:

Lazy Evaluator

A version of the lazy evaluator is in ~cs61as/lib/lazy.scm

Labwork

finish this during section

Exercise 1.

Abelson & Sussman, exercises 4.27 and 4.29.

Homework

do this in section if possible; finish the rest at home

Note:

The homework has been separated into crucial questions and less crucial questions, but you have to do all of them - this separation is just so that you know which ones to attempt first.

Exercise 2 (Crucial).

Abelson & Sussman, exercises 4.25, 4.26 and 4.28.

Exercise 3 (Less crucial).

Abelson & Sussman, exercises 4.30, 4.32 and 4.33.

Exercise 4.

Do the following reading:

Extra for Experts

Do this if you want to. This is NOT for credit.

Exercise 5.

Abelson & Sussman, exercise 4.31. This exercise doesn't require great brilliance, but it's a lot of work and involves a lot of debugging of details. On the other hand, completing this exercise will teach you a lot about the evaluator.

Exercise 6.

Fix the handle-infix procedure from project 4 to handle infix precedence for arithmetic operators properly. That is, multiplications and divisions should be done before additions and subtractions. Comparison operators like = come last of all.