diff options
Diffstat (limited to 'src/common.lisp')
-rw-r--r-- | src/common.lisp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common.lisp b/src/common.lisp index 2c56184..c9e6e8b 100644 --- a/src/common.lisp +++ b/src/common.lisp @@ -15,3 +15,8 @@ (defun trim (input) (string-trim '(#\Space #\Newline #\Backspace #\Tab #\Linefeed #\Page #\Return #\Rubout) input)) + +(defun fold-left (reducer initial list) + (loop for fold = initial then (funcall reducer fold element) + for element in list + finally (return fold))) |