aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/lisp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/lisp.c b/lisp/lisp.c
index 24a4788..e1524a4 100644
--- a/lisp/lisp.c
+++ b/lisp/lisp.c
@@ -252,7 +252,13 @@ sv_t serialise(context_t *ctx, lisp_t *ptr)
lmember = CAR(lmember);
sv_t member = serialise(ctx, lmember);
- s = sv_concat(&ctx->scratch, s, member);
+ if (!s.data)
+ s = member;
+ else
+ s = sv_concat(&ctx->scratch, s, member);
+
+ // NOTE: eventually this separator we add per item should be mutable at
+ // runtime.
if (IS_TAG(lsp, CONS) && !CDR(lsp))
continue;
else if (IS_TAG(CDR(lsp), CONS))