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

Consistently use class_ prefix for base wrappers #207

Merged
merged 18 commits into from
Mar 17, 2022
Merged

Consistently use class_ prefix for base wrappers #207

merged 18 commits into from
Mar 17, 2022

Conversation

hadley
Copy link
Member

@hadley hadley commented Mar 15, 2022

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.

Copy link
Collaborator

@DavisVaughan DavisVaughan left a 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!

NEWS.md Outdated Show resolved Hide resolved
#' * `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`.
Copy link
Collaborator

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

Copy link
Member Author

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`.
#'
Copy link
Collaborator

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?

Copy link
Member Author

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()

R/property.R Outdated Show resolved Hide resolved
hadley and others added 4 commits March 17, 2022 11:06
Co-authored-by: Davis Vaughan <davis@rstudio.com>
Conflicts:
	tests/testthat/_snaps/class.md
@hadley hadley merged commit 87d8b3d into main Mar 17, 2022
@hadley hadley deleted the class-align branch March 17, 2022 16:34
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.

Consider eliminating string representation of base types
2 participants