Is there something like apply-partially
(apply-partially FUN &rest ARGS)
Return a function that is a partial application of FUN to ARGS.
ARGS is a list of the first N arguments to pass to FUN.
The result is a new function which does the same as FUN, except that
the first N arguments are fixed at the values with with which this
function was called.
But with the "last N arguments are fixed"
Or "all arguments are fixed except wildcard" ie:
(defun foo (a b c))
(defalias 'fix-a-c-in-foo 'apply-partially-wildcard 'foo "a valuel" '_ "c value")
_
- random symbol that means "wildcard"
fset
-form in the followingprogn
sufficient for your purpose?(progn (defun f(a1 a2) (+ a1 a2)) (let ((a2 2)) (fset #'f2 `(lambda (_) (f _ ,a2)))) (f2 1))
subr.el
doesn't have one, but you could borrow one from here: github.com/magnars/dash.el#-rpartial-fn-rest-args-cut
from dash.el-cut
looks promising. Thx!