From 6bccfe8a55a12ef162fd945633c130f8b3362529 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 27 May 2024 20:20:14 -0700 Subject: quasiliterals: buffers in hex, separation for strings and buffers. In this commit, output variables in the TXR Pattern language and in TXR Lisp quasiliterals now support separator strings for values that are strings and buffers. Values which are buffers appear --- eval.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index eef6ba44..f63e01a1 100644 --- a/eval.c +++ b/eval.c @@ -2979,14 +2979,18 @@ static val fmt_tostring(val obj) static val fmt_cat(val obj, val sep) { + val self = lit("quasistring formatting"); + switch (type(obj)) { case LIT: case STR: case LSTR: - return obj; + return if3(null_or_missing_p(sep), obj, fmt_str_sep(sep, obj, self)); case BUF: if (!opt_compat || opt_compat > 294) - return tostringp(obj); + return if3(null_or_missing_p(sep), + fmt_cat(tostringp(obj), sep), + buf_str_sep(obj, sep, self)); /* fallthrough */ default: return if3(if3(opt_compat && opt_compat <= 174, listp(obj), seqp(obj)), -- cgit v1.2.3