summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-07-17 20:28:13 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-07-17 20:28:13 -0700
commit316989208db6191c12b2e0a628128759e2b84686 (patch)
tree80057be371f00a83bcfdb6d61606ee4d1021d30d
parentaef6d7be1fefd075e168bae753b9efadab0ac7dd (diff)
downloadtxr-316989208db6191c12b2e0a628128759e2b84686.tar.gz
txr-316989208db6191c12b2e0a628128759e2b84686.tar.bz2
txr-316989208db6191c12b2e0a628128759e2b84686.zip
printer: print (sys:vector-list ()) as #() not #nil.
* lib.c (obj_print_impl): Check for this case and handle. The #nil syntax is not readable.
-rw-r--r--lib.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index 8ba7cd3c..cf887d4e 100644
--- a/lib.c
+++ b/lib.c
@@ -14591,7 +14591,10 @@ val obj_print_impl(val obj, val out, val pretty, struct strm_ctx *ctx)
obj_print_impl(arg, out, pretty, ctx);
} else if (sym == vector_lit_s && two_elem) {
put_char(chr('#'), out);
- obj_print_impl(arg, out, pretty, ctx);
+ if (!arg)
+ put_string(lit("()"), out);
+ else
+ obj_print_impl(arg, out, pretty, ctx);
} else if (sym == hash_lit_s) {
put_string(lit("#H"), out);
if (!args)