I was testing this code in guile:
> (define xxx (let ((x '(1 2 3))) (set-cdr! (cddr x) x) x))
> xxx
it display (1 2 3)
but this:
(define x '(1 2 3))
(set-cdr! (cddr x) x)
x
=> (1 2 3 . #-2#)
creates circular list
Why first code don't work in guile? If you don't know about guile I just want to know if it should work according to scheme spec, don't know where to search for such things.