Breaking changes
-
Formal arguments of
partial(..f, ...)
no longer record the original
default values of..f
(since a default-value expression may reference an
argument that is fixed, and therefore dropped, bypartial()
).
Nevertheless, any default values of..f
not overridden bypartial()
remain in force when the functionpartial(..f, ...)
is called. -
partial(..f, ...)
can still fix arguments that match the...
argument of
..f
(if present), but only when such arguments are specified by name.
Bug fix
- Default argument values of a composite function are now evaluated in the
evaluation environment of the initial function. Essentially, a call like
compose(f, g)(x, y, ...)
is now equivalent to a call like
(function(...) g(f(...)))(x, y, ...)
. (Previously, the initial
function was called with a complete set of formal arguments, which in cases
where formal arguments are mutated or mutually referenced (e.g., in the
formals ofbase::objects()
), could lead the initial function to wrongly
determine the "missingness" of an argument or wrongly evaluate an argument's
default value.) As before, the signature ofcompose(f, ...)
inherits the
signature off
.