mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
core-lib: add doom-partial & doom-rpartial functions
This commit is contained in:
@ -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
|
||||||
|
Reference in New Issue
Block a user