Skip to content

feat: with_pattern() has a method for (plain) lists - #139

Merged
trevorld merged 1 commit into
mainfrom
feat/with-pattern-list
Nov 14, 2026
Merged

trevorld merged 1 commit into
mainfrom
feat/with-pattern-list

Conversation

@trevorld

Copy link
Copy Markdown
Owner
  • 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. For example, ggplot2::geom_sf() returns a list of a layer and a coord, which works once {ggpattern} has methods for both.
    • An element without a method is an error. {ggpattern} adds a with_pattern.Coord() method that returns the coord unchanged.
    • An empty list is returned 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" (field x_class). Its hint now names {gridpattern} instead of "This package", which read oddly when the call came through {ggpattern}.
  • Bumps the version to 1.6.0-16 (the minimum the {ggpattern} with-pattern-list branch requires).

Related: #131

🤖 Generated with Claude Code

* `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>
@trevorld
trevorld merged commit 4290be8 into main Nov 14, 2026
4 checks passed
@trevorld
trevorld deleted the feat/with-pattern-list branch November 14, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant