From dc4a7e000f2c3341acd86f7a4364b8a9eecb15b8 Mon Sep 17 00:00:00 2001 From: Raymond Toy <toy.raymond@gmail.com> Date: Sun, 28 Jan 2018 18:20:20 -0800 Subject: [PATCH] Fix #47: Print backquote multiple splices correctly * Print multiple splices correclty without the extra set of parenthesis around each splice. * Add test for this. --- src/code/backq.lisp | 3 ++- tests/issues.lisp | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/code/backq.lisp b/src/code/backq.lisp index ece7f42a7..b56a9e51d 100644 --- a/src/code/backq.lisp +++ b/src/code/backq.lisp @@ -263,7 +263,8 @@ (backq-unparse (car tail) t))) (push (backq-unparse (car tail)) accum))) (backq-append - (mapcar #'(lambda (el) (backq-unparse el t)) + (mapcar #'(lambda (el) + (car (backq-unparse el t))) (cdr form))) (backq-nconc (mapcar #'(lambda (el) (backq-unparse el :nconc)) diff --git a/tests/issues.lisp b/tests/issues.lisp index 4cb8f20f7..01db16b3e 100644 --- a/tests/issues.lisp +++ b/tests/issues.lisp @@ -434,4 +434,12 @@ "./" test-dir-name "ls-link"))))) - + +(define-test issue.47 + (:tag :issues) + (with-standard-io-syntax + (assert-equal "`(,@VARS ,@VARS)" + (with-output-to-string (s) + (write (read-from-string "`(,@vars ,@vars)") + :pretty t + :stream s))))) -- GitLab