about summary refs log tree commit diff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/klatre/klatre.lisp10
-rw-r--r--lisp/klatre/package.lisp5
2 files changed, 14 insertions, 1 deletions
diff --git a/lisp/klatre/klatre.lisp b/lisp/klatre/klatre.lisp
index 50cc510502e8..1c8d4c4d2e5b 100644
--- a/lisp/klatre/klatre.lisp
+++ b/lisp/klatre/klatre.lisp
@@ -94,3 +94,13 @@ separated by SEP."
   (check-type str string)
   (handler-case (parse-integer str)
     (sb-int:simple-parse-error (_) nil)))
+
+;;;
+;;; Function utilities
+;;;
+
+(defun partial (f &rest args)
+  "Return a function that calls F with ARGS prepended to any remaining
+  arguments"
+  (lambda (&rest more-args)
+    (apply f (append args more-args))))
diff --git a/lisp/klatre/package.lisp b/lisp/klatre/package.lisp
index 2e6340167909..21f659ef18b1 100644
--- a/lisp/klatre/package.lisp
+++ b/lisp/klatre/package.lisp
@@ -10,4 +10,7 @@
 
    ;; String handling
    #:+dottime-format+ #:format-dottime
-   #:try-parse-integer))
+   #:try-parse-integer
+
+   ;; Function utilities
+   #:partial))