Blob


1 (define (test-case actual expected)
2 (newline)
3 (display "Actual: ")
4 (display actual)
5 (newline)
6 (display "Expected: ")
7 (display expected)
8 (newline))
10 (define (last-pair x)
11 (if (null? (cdr x))
12 x
13 (last-pair (cdr x))))
15 (define (make-cycle x)
16 (set-cdr! (last-pair x) x)
17 x)
19 Draw a box-and-pointer diagram that shows the structure z created by
21 (define z (make-cycle (list 'a 'b 'c)))
23 What happens if we try to compute (last-pair z)?