-
Notifications
You must be signed in to change notification settings - Fork 38
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
Consistently use class_
prefix for base wrappers
#207
Conversation
Update index
Conflicts: README.Rmd README.md tests/testthat/test-method-dispatch.R
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a big net positive for consistency!
#' * `class_atomic` is a union of `class_logical`, `class_numeric`, | ||
#' `class_complex`, and `class_raw`. | ||
#' * `class_vector` is a union of `class_atomic`, `class_list`, and | ||
#' `class_expression`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a random thought that class_numeric
and friends could be union_numeric
to be more self documenting, but that might not be a great idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's nice to have a common prefix here; and the prefix really means "some wrapper around a base class/type".
#' `class_complex`, and `class_raw`. | ||
#' * `class_vector` is a union of `class_atomic`, `class_list`, and | ||
#' `class_expression`. | ||
#' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you give any advice on how to name your own custom class objects anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope currently. I'll add something here saying that we reserve the class_
prefix and also add a little advice in new_class()
Co-authored-by: Davis Vaughan <davis@rstudio.com>
Conflicts: tests/testthat/_snaps/class.md
Fixes #170
@DavisVaughan I don't think you need to worry too much about the implementation as it should've been hard for me to screw it up, but a pass over the docs would be appreciated.