-
Notifications
You must be signed in to change notification settings - Fork 6
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
complex language object #32
Comments
Would be miraculously a 3 lines fix with We might have to reprogram |
There seems to be a logic in rlang to avoid recursion, probably for some stack issues since they stop at 100 anyway. But for our use case this should do it:
And we tweak it slightly because we're fine with the top level having attributes :
It works :) : library(constructive)
x <- quote(a(1)(2))
attr(x[[1]], "foo") <- "bar"
construct(x)
#> as.call(list(
#> quote(a(1)) |>
#> structure(foo = "bar"),
#> 2
#> ))
y <- quote(a(1))
y[[1]] <- mean
construct(y)
#> as.call(list(
#> as.function(alist(x = , ... = , UseMethod("mean")), envir = .BaseNamespaceEnv),
#> 1
#> ))
construct(y, data = list(mean = mean))
#> as.call(list(mean, 1)) |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary. |
For now we rely on
rlang::express_deparse()
, which is better thanbase::deparse()
but insufficient nevertheless.These seem like artificial cases but :
Created on 2022-09-01 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: