summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-11-10 20:48:39 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-11-10 20:48:39 -0800
commit12fc8a196dd7cfa4ef9413d7fde7545c78d1a017 (patch)
treebfdb1c0221e25814f3a547b8c9bb5e4678f904d4 /lib.c
parentb20f57e55eea53a570c1fb59961173035f00f8dc (diff)
downloadtxr-12fc8a196dd7cfa4ef9413d7fde7545c78d1a017.tar.gz
txr-12fc8a196dd7cfa4ef9413d7fde7545c78d1a017.tar.bz2
txr-12fc8a196dd7cfa4ef9413d7fde7545c78d1a017.zip
Handle interpreted functions in circle printing.
Interpreted functions print as #<interpreted fun: name args>, 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.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index b4452cbb..24b39747 100644
--- a/lib.c
+++ b/lib.c
@@ -9794,6 +9794,13 @@ tail:
}
}
break;
+ case FUN:
+ if (obj->f.functype == FINTERP) {
+ val fun = obj->f.f.interp_fun;
+ populate_obj_hash(car(fun), ctx);
+ obj = cadr(fun);
+ goto tail;
+ }
default:
break;
}