core: Reenable full printing of lists.

* src/lib.c (display_helper): Reenable full printing of lists.
This commit is contained in:
Jan Nieuwenhuizen 2018-04-21 08:54:14 +02:00
parent 4b6d11e990
commit 82db3a941a
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 4 additions and 11 deletions

View File

@ -57,7 +57,7 @@ display_helper (SCM x, int cont, char* sep, int fd, int write_p)
case TCLOSURE: case TCLOSURE:
{ {
fputs ("#<closure ", fd); fputs ("#<closure ", fd);
//display_helper (CDR (x), cont, "", fd, 0); display_helper (CDR (x), cont, "", fd, 0);
fputs (">", fd); fputs (">", fd);
break; break;
} }
@ -100,22 +100,15 @@ display_helper (SCM x, int cont, char* sep, int fd, int write_p)
{ {
if (!cont) if (!cont)
fputs ("(", fd); fputs ("(", fd);
if (CAR (x) == cell_closure) if (CAR (x) == cell_circular
fputs ("*closure* ", fd); && CADR (x) != cell_closure)
else
if (CAAR (x) == cell_closure)
fputs ("(*closure* ...) ", fd);
else
if (CAR (x) == cell_circular)
{ {
fputs ("(*circ* . ", fd); fputs ("(*circ* . ", fd);
int i = 0; int i = 0;
x = CDR (x); x = CDR (x);
while (x != cell_nil && i++ < 10) while (x != cell_nil && i++ < 10)
{ {
g_depth = 1; fdisplay_ (CAAR (x), fd, write_p); fputs (" ", fd);
display_helper (CAAR (x), 0, "", fd, write_p); fputs (" ", fd);
//fdisplay_ (CAAR (x), fd, write_p); fputs (" ", fd);
x = CDR (x); x = CDR (x);
} }
fputs (" ...)", fd); fputs (" ...)", fd);