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

Consider supporting "{var}" = foo and superseding := #1296

Closed
lionel- opened this issue Oct 7, 2021 · 3 comments
Closed

Consider supporting "{var}" = foo and superseding := #1296

lionel- opened this issue Oct 7, 2021 · 3 comments

Comments

@lionel-
Copy link
Member

lionel- commented Oct 7, 2021

No description provided.

@lionel- lionel- changed the title Consider supporting "{var} = foo" and superseding := Consider supporting "{var}" = foo and superseding := Nov 4, 2021
@lionel-
Copy link
Member Author

lionel- commented Feb 20, 2023

Unfortunately we can't enable glue interpolation in = because this is incompatible with the way the compiler optimises promises away:

fn <- function() {
  foo <- "foo"
  rlang::list2("{foo}" = NULL)
}

# First time is fine
fn()
#> $foo
#> NULL

# After compilation we no longer have env info
fn()
#> Error:
#> ! object 'foo' not found

@lionel- lionel- closed this as completed Feb 20, 2023
lionel- added a commit that referenced this issue Feb 20, 2023
@psychelzh
Copy link
Contributor

Does this mean "var" = foo will never be possible?

@lionel-
Copy link
Member Author

lionel- commented May 2, 2023

Unfortunately yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants