chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Printing circular lists


From: Jeronimo Pellegrini
Subject: [Chicken-users] Printing circular lists
Date: Tue, 3 Aug 2010 17:03:56 -0300
User-agent: Mutt/1.5.20 (2009-06-14)

Hello,

In the REPL, the following:

(define a (list 1 2))
(set-cdr! a a)
a

shows some elements of a, then prints an ellipsis:

(a a a a a a a a ...

But "(print a)" enters an infinite loop (so does display and
pretty-print).

I was wondering how to get Chicken to print cyclic structures
using references to previous elements instead of looping, like
this, for example (this is what Gauche does on the REPL, and
what Guile's display implementation does):

 > a
 #0=(1 . #0#)

Is there some way to configure Chicken to do that? (I've searched
the wiki but found nothing)

Thanks!
J.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]