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

Closes #1655 add back-compatibility to expr_label() for incoming is.atomic(NULL) change in R version 4.4 #1656

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

zdz2101
Copy link
Contributor

@zdz2101 zdz2101 commented Oct 4, 2023

Closes #1655

Copy of issue below:

One of the main "significant user-visible changes" for the upcoming R release, v4.4, is that:

  • is.atomic(NULL) now returns FALSE, as NULL is not an atomic vector. Strict back compatibility would replace is.atomic(foo) by (is.null(foo) || is.atomic(foo)) but should happen sparingly only.

expr_label(NULL) under R <4.4 would return "NULL"
expr_label(NULL) under R 4.4 would return "`NULL`"

Although expr_label() is already under lifecycle label questioning, this may have minor unintended consequences

expr_label <- function(expr) {
  if (is.character(expr)) {
    encodeString(expr, quote = '"')
  } else if (is.atomic(expr)) { # should this be replaced with (is.null(expr) || is.atomic(expr))  ?
    format(expr)
  } else if (is.name(expr)) {
    paste0("`", as.character(expr), "`")
  } else {
    chr <- deparse_one(expr)
    paste0("`", chr, "`")
  }
}

@lionel- lionel- merged commit 2a831ef into r-lib:main Oct 5, 2023
12 checks passed
@lionel-
Copy link
Member

lionel- commented Oct 5, 2023

Thanks!

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.

expr_label() has a reference to is.atomic() that will be affected by incoming R version 4.4
2 participants