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

execute an expression vs a function #72

Closed
schloerke opened this issue Aug 1, 2018 · 1 comment
Closed

execute an expression vs a function #72

schloerke opened this issue Aug 1, 2018 · 1 comment

Comments

@schloerke
Copy link

With the rise of rlang, does it make sense to add quosure evaluation functionality?

Ex:

safe <- function(expr, ...) {
  expr <- rlang::enquo(expr)
  callr::r(function(e) rlang::eval_tidy(e), list(e = expr), ...)
}

# Direct usage
safe(cat("1", file = "test.txt"))

# Programmatic usage
exp <- quote(cat("2", file = "test.txt"))
safe(!!exp)

x <- "3"
safe(cat(!!x, file = "test.txt"))
@schloerke
Copy link
Author

Talked with Gabor. Keeping this function out of callr for the time being.

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

No branches or pull requests

1 participant