From 12fc8a196dd7cfa4ef9413d7fde7545c78d1a017 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 10 Nov 2016 20:48:39 -0800 Subject: Handle interpreted functions in circle printing. Interpreted functions print as #, thus repeating some list structure in their notation. This means we must traverse them when populating the object hash during printing, and also when backpatching after parsing. Test case: evaluate and print (let ((s '(lambda (a b c) d))) (list s (eval s))) with *print-circle* enabled. * lib.c (populate_obj_hash): Handle FUN objects of functype FINTERP. * parser.c (circ_backpatch): Likewise. --- parser.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'parser.c') diff --git a/parser.c b/parser.c index bf243711..75dbb89b 100644 --- a/parser.c +++ b/parser.c @@ -333,6 +333,13 @@ tail: } } break; + case FUN: + if (obj->f.functype == FINTERP) { + val fun = obj->f.f.interp_fun; + circ_backpatch(p, &cs, car(fun)); + obj = cadr(fun); + goto tail; + } default: break; } -- cgit v1.2.3