projects
/
jscl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a94bce9
)
Updated join function in utils.lisp
author
maxwellhansen
<maxwellhansen@hotmail.com>
Fri, 26 Apr 2013 05:37:09 +0000
(22:37 -0700)
committer
maxwellhansen
<maxwellhansen@hotmail.com>
Fri, 26 Apr 2013 05:37:09 +0000
(22:37 -0700)
Used !reduce instead of verbose conditional recursion.
src/utils.lisp
patch
|
blob
|
history
diff --git
a/src/utils.lisp
b/src/utils.lisp
index
3cf0103
..
5a66bf6
100644
(file)
--- a/
src/utils.lisp
+++ b/
src/utils.lisp
@@
-37,15
+37,9
@@
;;; Concatenate a list of strings, with a separator
(defun join (list &optional (separator ""))
- (cond
- ((null list)
- "")
- ((null (cdr list))
- (car list))
- (t
- (concat (car list)
- separator
- (join (cdr list) separator)))))
+ (!reduce (lambda (s o) (concat s separator o))
+ (cdr list)
+ :initial-value (car list)))
(defun join-trailing (list &optional (separator ""))
(if (null list)