diff --git a/test/test-core.lisp b/test/test-core.lisp index 8b7dd3c..5b69df6 100644 --- a/test/test-core.lisp +++ b/test/test-core.lisp @@ -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)) diff --git a/util/util.lisp b/util/util.lisp index aca0a0a..6f7d181 100644 --- a/util/util.lisp +++ b/util/util.lisp @@ -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