This is my first shot at lisp (or a programming course of any kind) but I enjoyed it. Also, sorry if the formatting is crap.
Exercise 1.1
10
12
8
3
6
"a --> 3"
"b --> 4"
19
f
4
16
6
16
Exercise 1.2
(/ (+ 5 4 (- 2 (- 3 (+ 6 (/ 4 5))))) (* 3 (- 6 (- 2 7))))
Exercise 1.3
(define (sumsq x y z)
(if (> x y) (if (> y z) (+ ( x x) ( y y)) (+ ( x x) ( z z)))
(if (or (> z y) (> z x)) (+ ( z z) ( y y)) (+ ( x x) ( y y)))
)
)
Exercise 1.4
The procedure uses a conditional, in this case the if statement, in the place of an operator. This allows the function to evaluate the statement b>0 before determining which operator should be used in combining a and b.
Exercise 1.5
Applicative order evaluates all operators and operands before applying the resulting procedures. This causes the infinite loop procedure (p) to be evaluated before the if statement. If the interpreter used normal evaluation the if statement would be evaluated before the (p) procedure was called and would cause the program to bypass (p) and return 0.
Exercise 1.6
Applicative order evaluation will cause both the then-clause and the else-clause to be evaluated which will lead to infinite recursion as the else clause has no exit point.
Exercise 1.7
For any number smaller than the cut off given in good-enough? the sqrt function will be inaccurate as it will stop once the square of the guess is less than the cut off. For large numbers, the number of iterations necessary to find an acceptable answer will lead to the accumulation of small arithmetic errors that are added in each step.