util🍛 fix: only fn as parameter
This commit is contained in:
parent
ec21964068
commit
115121ec9f
2 changed files with 5 additions and 4 deletions
|
@ -72,8 +72,8 @@
|
||||||
(t:show-result))))
|
(t:show-result))))
|
||||||
|
|
||||||
(deftest test-util ()
|
(deftest test-util ()
|
||||||
(let* ((25+ (util:curry #'+ 25))
|
(let* ((25+ (funcall (util:curry #'+) 25))
|
||||||
(35+ (util:curry 25+ 10)))
|
(35+ (funcall (util:curry 25+) 10)))
|
||||||
(== (funcall 35+ 7) 42))
|
(== (funcall 35+ 7) 42))
|
||||||
(let ((now (get-universal-time)))
|
(let ((now (get-universal-time)))
|
||||||
(== (util:from-unix-time (util:to-unix-time now)) now))
|
(== (util:from-unix-time (util:to-unix-time now)) now))
|
||||||
|
|
|
@ -22,8 +22,9 @@
|
||||||
|
|
||||||
;;;; functional tools
|
;;;; functional tools
|
||||||
|
|
||||||
(defun curry (fn a)
|
(defun curry (fn)
|
||||||
(lambda (&rest args) (apply fn a args)))
|
(lambda (a)
|
||||||
|
(lambda (&rest args) (apply fn a args))))
|
||||||
|
|
||||||
;;;; formatting and logging shortcuts
|
;;;; formatting and logging shortcuts
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue