Repository navigation
feat: with_pattern() has a method for (plain) lists - #139
Merged
Merged
Conversation
* `with_pattern.list()` patterns each element of a list with its own `with_pattern()` method
(with the same arguments), keeping the list's names and other attributes
e.g. the list of a `{ggplot2}` layer and coord that `ggplot2::geom_sf()` returns
(once `{ggpattern}` has methods for both).
An element without a method is an error and an empty list is returned as it is.
* `with_pattern()`'s error for an object without a method now has class `"gridpattern_no_method"`
(field `x_class`) and its hint names `{gridpattern}`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
with_pattern.list()patterns each element of a list with its ownwith_pattern()method (with the same arguments), keeping the list's names and other attributes. For example,ggplot2::geom_sf()returns a list of a layer and a coord, which works once{ggpattern}has methods for both.{ggpattern}adds awith_pattern.Coord()method that returns the coord unchanged....is forwarded unchecked, so a parameter with one value per area must have one value per area of each element.with_pattern()'s error for an object without a method now has class"gridpattern_no_method"(fieldx_class). Its hint now names{gridpattern}instead of "This package", which read oddly when the call came through{ggpattern}.{ggpattern}with-pattern-listbranch requires).Related: #131
🤖 Generated with Claude Code