X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=lispstrack.lisp;h=6d494437e75f63d3ef9b05fcbba17c16a80b0292;hb=cde0e46ceeba0bf1eafcf43b13cd95a7eb14e6f7;hp=8a78bf50d8979a03f1e1ca9f9c2f635e90766308;hpb=b555a69d351b6be0ed61343d79a80771957a7413;p=jscl.git diff --git a/lispstrack.lisp b/lispstrack.lisp index 8a78bf5..6d49443 100644 --- a/lispstrack.lisp +++ b/lispstrack.lisp @@ -1,3 +1,11 @@ + +(defun !reduce (func list initial) + (if (null list) + initial + (!reduce func + (cdr list) + (funcall func initial (car list))))) + ;;; Utils #+common-lisp @@ -11,9 +19,9 @@ ;;; simplify me, please (defun concat (&rest strs) - (reduce (lambda (s1 s2) (concatenate 'string s1 s2)) - strs - :initial-value "")) + (!reduce (lambda (s1 s2) (concatenate 'string s1 s2)) + strs + "")) ;;; Concatenate a list of strings, with a separator (defun join (list separator)