util🍛 fix: only fn as parameter

This commit is contained in:
Helmut Merz 2025-07-29 09:04:23 +02:00
parent ec21964068
commit 115121ec9f
2 changed files with 5 additions and 4 deletions

View file

@ -72,8 +72,8 @@
(t:show-result))))
(deftest test-util ()
(let* ((25+ (util:curry #'+ 25))
(35+ (util:curry 25+ 10)))
(let* ((25+ (funcall (util:curry #'+) 25))
(35+ (funcall (util:curry 25+) 10)))
(== (funcall 35+ 7) 42))
(let ((now (get-universal-time)))
(== (util:from-unix-time (util:to-unix-time now)) now))

View file

@ -22,8 +22,9 @@
;;;; functional tools
(defun curry (fn a)
(lambda (&rest args) (apply fn a args)))
(defun curry (fn)
(lambda (a)
(lambda (&rest args) (apply fn a args))))
;;;; formatting and logging shortcuts