You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
343 B
16 lines
343 B
|
|
Exercise 3.13: Consider the following
|
|
make-cycle procedure, which uses the last-pair procedure defined
|
|
in Exercise 3.12:
|
|
|
|
|
|
(define (make-cycle x)
|
|
(set-cdr! (last-pair x) x)
|
|
x)
|
|
|
|
Draw a box-and-pointer diagram that shows the structure z created by
|
|
|
|
|
|
(define z (make-cycle (list 'a 'b 'c)))
|
|
|
|
What happens if we try to compute (last-pair z)?
|
|
|