purrr icon indicating copy to clipboard operation
purrr copied to clipboard

`chuck()` and `pluck()` should check for unnamed dots

Open mgirlich opened this issue 4 years ago • 0 comments

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.

mgirlich avatar Aug 13 '20 06:08 mgirlich