4 we use a unique hash and store them into a set. If we again hit an element
5 with the same hash, we have hit a cycle. For simplicity, we use car of a cell
6 as the hash. So for this procedure to work, we will need unique values in each
15 (define (make-cycle x)
16 (set-cdr! (last-pair x) x)
19 (define z (make-cycle (list 'a 'b 'c)))
22 (define (contains-cycle? x trail)
28 (else (contains-cycle? (cdr x) (cons f trail))))))
29 (contains-cycle? x '()))