[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] display with cyclic structures or just limit on char
Re: [Chicken-users] display with cyclic structures or just limit on characters?
Wed, 16 Feb 2011 03:22:14 -0500 (EST)
From: Patrick Li <address@hidden>
Subject: [Chicken-users] display with cyclic structures or just limit on
Date: Tue, 15 Feb 2011 23:39:40 -0500
> Hello everyone,
> I'm just debugging some software with display statements, except that I am
> using some cyclic data structures.
> If I use (display my-data-structure) on a cyclic structure, it just floods
> the screen and crashes the program.
> Is there an existing cycle-detecting pretty-printer for Chicken? Or just a
> simple way of limiting the number of characters that (display) will output?
There is the srfi-38 egg, which supports circular data. Alternatively,
you can use the internal function
(##sys#with-print-length-limit LIMIT THUNK)
But srfi-38 is recommended.