I have a function f: (a, b, c = 5, d = 0) -> {...}
that takes between 2 and 4 arguments.
I want to pass a "bound" version of this function that always uses the defaults for the last arguments, but uses specific values (say 1 and 2) for the first two arguments. That is, I want g: () -> f(1, 2)
.
If I were to do partial application, I would get g': (c = 5, d = 0) -> f(1, 2, c, d)
. That is, partial application wouldn't enforce the zero-argument nature of g
that I desire, instead giving me g'
which takes between 0 and 2 arguments.
What is the technique for getting g
from f
called, if anything?