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