Skip to content
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

chuck() and pluck() should check for named dots #788

Closed
mgirlich opened this issue Aug 13, 2020 · 0 comments · Fixed by #897
Closed

chuck() and pluck() should check for named dots #788

mgirlich opened this issue Aug 13, 2020 · 0 comments · Fixed by #897
Labels
feature a feature request or enhancement pluck 🍐

Comments

@mgirlich
Copy link
Contributor

I accidentally used chuck() instead of pluck() and was quite confused by the error as I provided a default. It was something along the lines of

purrr::chuck(list(a = NULL), "a", .default = "a")
#> Error: Plucked object can't be NULL

Created on 2020-08-13 by the reprex package (v0.3.0)

Then I realised that I actually wanted to use pluck() and .default was actually used as an index.

I guess chuck() and pluck() should use ellipsis::check_dots_unnamed(). At least for chuck() and .default this would make sense.

@hadley hadley added feature a feature request or enhancement pluck 🍐 labels Aug 24, 2022
@hadley hadley changed the title chuck() and pluck() should check for unnamed dots chuck() and pluck() should check for named dots Aug 27, 2022
hadley added a commit that referenced this issue Aug 28, 2022
hadley added a commit that referenced this issue Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement pluck 🍐
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants