Repository navigation
Support existing functions in crate() - #37
Merged
Merged
Conversation
hadley
reviewed
Jul 20, 2026
hadley
approved these changes
Jul 20, 2026
hadley
left a comment
Member
There was a problem hiding this comment.
This approach is fine with me. I assume we should do a revdep pass for purrr just in case any CRAN package relies on the existing behaviour for function factories?
Co-authored-by: Hadley Wickham <hadley@posit.co>
hadley
reviewed
Jul 21, 2026
Co-authored-by: Lionel Henry <lionel.hry@proton.me>
Member
Author
|
Revdeps for both carrier and purrr come back clean. I checked purrr using |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #36. See the issue for the full design history and motivation.
crate()no longer requires.fnto be defined inside the call. Existing functions are handled by type:crate(rlang::set_env(fn))workaround....data that would be unreachable from the resulting crate (existing crate, namespace function, or primitive) is an error.The factory-closure pitfall (e.g.
stats::ecdf()results losing captured state) is documented with an example rather than guarded heuristically, as discussed in #36.