You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In rlang, an expression is the return type of parse_expr(), the set of objects
that can be obtained from parsing R code
x<- quote(a(1)(2))
attr(x[[1]], "foo") <-"bar"# I'm ok with thisrlang::expr_deparse(x)
#> [1] "a(1)(2)"# But then doesn't this mean this should be FALSE ?rlang::is_expression(x)
#> [1] TRUE
Ah indeed good catch, I believe this implies that using current definition quote({a}) is not an expression either.
Maybe we could have is_expression(x, ignore_attr = TRUE, ignore_srcref = TRUE) , these are arguments we find in waldo::compare().
Maybe we could have is_expression(x, ignore_attr = TRUE, ignore_srcref = TRUE) , these are arguments we find in waldo::compare().
I'm not looking into extending the feature set of is_expression() further. I now regret having added it to the package because it doesn't seem worth the maintenance effort.
From
?rlang::is_expression
:Created on 2022-09-02 by the reprex package (v2.0.1)
For context in S4 objects we can find calls with attributes.
The text was updated successfully, but these errors were encountered: