diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2024-05-27 20:20:14 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2024-05-27 20:20:14 -0700 |
commit | 6bccfe8a55a12ef162fd945633c130f8b3362529 (patch) | |
tree | 2c0c75c5022003f0de0f8d6f20bfa70bc76d9266 /eval.c | |
parent | 55cf3cae3665cab1264fe00ec31859d8dba13027 (diff) | |
download | txr-6bccfe8a55a12ef162fd945633c130f8b3362529.tar.gz txr-6bccfe8a55a12ef162fd945633c130f8b3362529.tar.bz2 txr-6bccfe8a55a12ef162fd945633c130f8b3362529.zip |
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
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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)), |