Call a function with a specified number of leading arguments forced before the call if the function is a closure.
number of leading arguments to force.
function to call.
forceAndCall calls the function
FUN with arguments
.... If the value of
FUN is a closure
then the first
n arguments to the function are evaluated
(i.e. their delayed evaluation promises are forced) before executing
the function body. If the value of
FUN is a primitive then
FUN(...) is evaluated in the usual way.
forceAndCall is intended to help defining higher order
apply to behave more reasonably when the
result returned by the function applied is a closure that captured its
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.