summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-11-27 07:29:21 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-11-27 07:29:21 -0800
commitecc3981b8bdee6db1571edea88e55211d8dc0390 (patch)
treefb8451562f14ec95a91e59864a159a36ed399db9 /lib.c
parentd3ec00fccdb41291b0c884c4074bd7c6232a3db3 (diff)
downloadtxr-ecc3981b8bdee6db1571edea88e55211d8dc0390.tar.gz
txr-ecc3981b8bdee6db1571edea88e55211d8dc0390.tar.bz2
txr-ecc3981b8bdee6db1571edea88e55211d8dc0390.zip
bugfix: read-print consistency for @(expr).
* lib.c (obj_print_impl): Only print (sys:expr x . rest) as @x if rest is nil, and x is a cons. Otherwise we create read-print problems: (sys:expr x y) prints as @x, concealing y. And (sys:expr sym) prints as @sym which reads as (sys:var sym).
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index 2b1be171..299263e6 100644
--- a/lib.c
+++ b/lib.c
@@ -9557,7 +9557,7 @@ val obj_print_impl(val obj, val out, val pretty, struct strm_ctx *ctx)
{
put_char(chr('@'), out);
obj_print_impl(second(obj), out, pretty, ctx);
- } else if (sym == expr_s) {
+ } else if (sym == expr_s && two_elem && consp(second(obj))) {
put_char(chr('@'), out);
obj_print_impl(second(obj), out, pretty, ctx);
} else if (sym == rcons_s && consp(cdr(obj))