-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Review UI of partial() #607
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like where this syntax ended up 😄
`...f`). This also makes `partial()` more consistent with other | ||
purrr function signatures. | ||
|
||
* The `.lazy` argument of `partial()` is soft-deprecated in favour of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:
-> .
?
NEWS.md
Outdated
signatures. | ||
|
||
* `partial()` now supports quasiquotation. When you unquote an | ||
argument, it is evaluated once and for all. This is more flexible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
once at function creation time ?
R/partial.R
Outdated
#' [rlang::call_modify()] to learn more about this syntax. | ||
#' | ||
#' These dots support quasiquotation and quosures. If you unquote a | ||
#' value, it is evaluated once and for all when the argument is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when the function is created.
Use quasiquotation to control timing of evaluation. Closes Extending partial() to comprehend quasiquotation #457.
Use
as_closure()
to allow argument matching of primitive functions. Closes Argument matching in partial() doesn't happen for primitive functions #360.Fix infloop when partialised functions is assigned back to the same symbol. Closes option to force evaluation of supplied function in partial to avoid infinite recursion #387.
Wrap around
call_modify()
. This allows user to control the position of...
in the partial function signature.These changes simplify the interface and make it more flexible. The
.lazy
,.env
, and.first
arguments are soft-deprecated.