Added rcurry.

Pascal J. Bourguignon [2019-05-20 04:16]
Added rcurry.
Filename
common-lisp/cesarum/utility.lisp
diff --git a/common-lisp/cesarum/utility.lisp b/common-lisp/cesarum/utility.lisp
index 21450a4..f52c2be 100644
--- a/common-lisp/cesarum/utility.lisp
+++ b/common-lisp/cesarum/utility.lisp
@@ -87,7 +87,7 @@
    "SIMPLE-PROGRAM-ERROR-FORMAT-ARGUMENTS"
    ;; 3 - EVALUATION AND COMPILATION
    "WITH-FUNCTIONS" "WITH-GENSYMS" "WSIOSBP" "PROGN-CONCAT"
-   "CURRY" "COMPOSE" "COMPOSE-AND-CALL"
+   "CURRY" "RCURRY" "COMPOSE" "COMPOSE-AND-CALL"
    "/NTH-ARG" "/APPLY"
    "DEFINE-IF-UNDEFINED"  "INCLUDE-FILE" "FUNCTIONAL-PIPE"
    "FIRST-ARG" "SECOND-ARG" "THIRD-ARG" "FOURTH-ARG" "FIFTH-ARG"
@@ -252,6 +252,10 @@ The *PACKAGE* is kept bound to the current package.
   (lambda (&rest right-arguments)
     (apply function (append left-arguments right-arguments))))

+(defun rcurry (function &rest right-arguments)
+  (lambda (&rest left-arguments)
+    (apply function (append left-arguments right-arguments))))
+
 ;; (defmacro curry (function &rest left-arguments)
 ;;   (let ((parameters (mapcar (lambda (arg) (gensym)) left-arguments))
 ;;         (right-arguments (gensym)))
ViewGit