From 72ea47cb951a774318ab045cf342882cad3ff55d Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 11 May 2022 08:08:34 -0700 Subject: Print ([...] . @var) and ([...] . @(expr)) notation. This change fixes objects like (@a @b . @c) being printed as (@a @b sys:var c). This is piggybacked into the logic which renders dotted unquotes. In other words, we are already printing (x . ,y) in that from rather than (x sys:unquote y); we just recognize sys:var, and sys:expr in the same code. * lib.c (obj_print_impl): Recognize dotted metavariables and metaexpressions similarly to dotted unquotes. --- lib.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib.c b/lib.c index 7c7422f2..95c1bd6b 100644 --- a/lib.c +++ b/lib.c @@ -13970,10 +13970,19 @@ val obj_print_impl(val obj, val out, val pretty, struct strm_ctx *ctx) val a = car(iter); val unq = nil; - if (a == sys_unquote_s) + if (a == sys_unquote_s) { unq = lit(". ,"); - else if (a == sys_splice_s) + } else if (a == sys_splice_s) { unq = lit(". ,*"); + } else if (a == var_s && consp(cdr(iter))) { + val ad = cadr(iter); + if (symbolp(ad) || integerp(ad)) + unq = lit(". @"); + } else if (a == expr_s && consp(cdr(iter))) { + val ad = cadr(iter); + if (consp(ad)) + unq = lit(". @"); + } if (unq) { val d = cdr(iter); -- cgit v1.2.3