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

empty vs NULL #45

Closed
jonthegeek opened this issue Aug 12, 2023 · 1 comment
Closed

empty vs NULL #45

jonthegeek opened this issue Aug 12, 2023 · 1 comment
Milestone

Comments

@jonthegeek
Copy link
Owner

A thing being empty might be an indication that the higher-level object that uses it should also be empty. For the use case that led me to develop stbl, I really need to allow specifically this!

to_cls(cls()) works, but to_cls_scalar(cls()) errors, even if allow_na = TRUE.

How should I handle this? Should I differentiate between empty and NULL? Should I sometimes coerce NULL to empty (particularly in stabilize_*)?

Judging from actual use, I think I probably want to default to allowing empty for to_cls_scalar(), but NOT allowing NULL.

@jonthegeek jonthegeek added this to the v0.1 milestone Aug 13, 2023
@jonthegeek
Copy link
Owner Author

I'm leaning toward something along these lines: an empty arg (or something like that) replaces allow_null (everywhere?). It has possible values along the lines of: c("coerce_to_vec", "coerce_to_null", "accept", "reject").

jonthegeek added a commit that referenced this issue Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

1 participant