core-lib: add doom-partial & doom-rpartial functions

This commit is contained in:
Henrik Lissner 2019-07-21 19:13:21 +02:00
parent ee10b3b0d9
commit 3404899ec3
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -177,6 +177,17 @@ Accepts the same arguments as `message'."
format-string) format-string)
,@args)))) ,@args))))
(defalias 'doom-partial #'apply-partially)
(defun doom-rpartial (fn &rest args)
"Return a function that is a partial application of FUN to right-hand ARGS.
ARGS is a list of the last N arguments to pass to FUN. The result is a new
function which does the same as FUN, except that the last N arguments are fixed
at the values with which this function was called."
(lambda (&rest pre-args)
(apply fn (append pre-args args))))
(cl-defun doom-files-in (cl-defun doom-files-in
(paths &rest rest (paths &rest rest
&key &key