--- a/src/iterate.lisp Tue Dec 14 19:09:58 2021 -0500
+++ b/src/iterate.lisp Tue Dec 14 19:10:21 2021 -0500
@@ -709,9 +709,11 @@
"
(if var
- (let ((sep (gensym "SEP")))
+ (let ((separator% (gensym "SEPARATOR"))
+ (sep (gensym "SEP")))
`(progn
- (with ,sep = ,(if separator (string separator) ""))
+ (with ,separator% = ,separator)
+ (with ,sep = (if ,separator% (string ,separator%) ""))
(reducing ,expr
:by (lambda (a b)
(if (null a)
@@ -719,11 +721,15 @@
(concatenate 'string a ,sep b)))
:into ,var
:initial-value nil)))
- (let ((sos (gensym "SOS"))
+ (let ((separator% (gensym "SEPARATOR"))
+ (sos (gensym "SOS"))
(sep (gensym "SEP")))
`(progn
+ (with ,separator% = ,separator)
(with ,sos = nil)
- (with ,sep = ,(if separator (string separator) nil))
+ (with ,sep = (if (or (null ,separator%) (equal ,separator% ""))
+ nil
+ (string ,separator%)))
(if (null ,sos)
(setf ,sos (make-string-output-stream))
(when ,sep