summaryrefslogtreecommitdiffstats
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
commit9ea1afcf8a9240ed2ab746e608ae904ba36d1f83 (patch)
treefb8451562f14ec95a91e59864a159a36ed399db9
parentf6396ea24080b1b1195480261d5b3de4a94e052a (diff)
downloadtxr-9ea1afcf8a9240ed2ab746e608ae904ba36d1f83.tar.gz
txr-9ea1afcf8a9240ed2ab746e608ae904ba36d1f83.tar.bz2
txr-9ea1afcf8a9240ed2ab746e608ae904ba36d1f83.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).
-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))