Closed moodymudskipper closed 1 year ago
This is the expected behaviour.
It's undocumented then AFAICT, I see:
enexpr() and enexprs() are like enquo() and enquos() but return naked expressions instead of quosures. These operators should very rarely be used because they lose track of the environment of defused arguments.
My intuition is that enexpr(x)
should be equivalent to quo_expr(enquo(x))
It could make sense to make it equivalent to quo_squash(enquo(x))
. But then every round of enexpr()
would fully traverse the AST. Even if we treat {{
differently, !!
could still be used to inject a quosure, hence we'd have to use quo_squash()
.
With the current design, the caller of enexpr()
(which is for experts) is in charge of squashing quosures if needed.
As a consequence this will have an unexpected output :