From ac07b88eb1161935cdbf8836f65258e44bfe7ab9 Mon Sep 17 00:00:00 2001 From: maxwellhansen Date: Thu, 25 Apr 2013 22:37:09 -0700 Subject: [PATCH] Updated join function in utils.lisp Used !reduce instead of verbose conditional recursion. --- src/utils.lisp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/utils.lisp b/src/utils.lisp index 3cf0103..5a66bf6 100644 --- 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) -- 1.7.10.4