projects
/
jscl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0774618
)
Fix: join fails on empty list
author
David Vázquez
<davazp@gmail.com>
Fri, 3 May 2013 11:36:01 +0000
(12:36 +0100)
committer
David Vázquez
<davazp@gmail.com>
Fri, 3 May 2013 11:36:01 +0000
(12:36 +0100)
src/utils.lisp
patch
|
blob
|
history
diff --git
a/src/utils.lisp
b/src/utils.lisp
index
73fc551
..
20aa855
100644
(file)
--- a/
src/utils.lisp
+++ b/
src/utils.lisp
@@
-37,9
+37,11
@@
;;; Concatenate a list of strings, with a separator
(defun join (list &optional (separator ""))
- (!reduce (lambda (s o) (concat s separator o))
- (cdr list)
- :initial-value (car list)))
+ (if (null list)
+ ""
+ (!reduce (lambda (s o) (concat s separator o))
+ (cdr list)
+ :initial-value (car list))))
(defun join-trailing (list &optional (separator ""))
(if (null list)