r-lib / rlang

Low-level API for programming with R
https://rlang.r-lib.org
Other
498 stars 136 forks source link

Add `check_list()` #1605

Closed DavisVaughan closed 1 year ago

DavisVaughan commented 1 year ago

Makes sense to me to have this lower level version too even if we have vctrs::obj_check_list()

DavisVaughan commented 1 year ago

Regarding list-of, yea kind of like the C++ all_of that we also modeled r_list_all_of() after https://en.cppreference.com/w/cpp/algorithm/all_any_none_of

I like the chained error idea, it could be like purrr and report the index of the issue

But yea ok i forgot about inherits(x, "list"). I'm happy to close this for now since we aren't really sure about that yet, and we can make the decision about that when we really need it. It isn't critical for me to have this.