core-lib: add doom-partial & doom-rpartial functions
This commit is contained in:
parent
ee10b3b0d9
commit
3404899ec3
1 changed files with 11 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue