Cycles detection in REPL
I have Scheme based lisp called LIPS and I've just fixed cycles detection, and I'm comparing with other Scheme systems. I've already reported issue in Gauche (gosh).
This is testing code that create cycles.
(define x (let ((x (list 1 (list 2) 3)))
(set-cdr! (cadr x) (cdr x))
(set-cdr! (cddr x) x)
x))
Try typing x
.
I'm not sure if processing cycles (mainly displaying it) is standarized. I thought that I was testing cycles in guile and Kawa when I've had first version of my code, but it seems that this don't work and prints lot of exceptions.
I've just checked (write x)
and it seems that it's problem with REPL because it prints the value correctly:
#|kawa:10|# (write x)
#0=(1 . #1=((2 . #1#) 3 . #0#))
Edited by Jakub T. Jankiewicz