quo_squash() flattens all nested quosures within an expression.
For example it transforms
^foo(^bar(), ^baz) to the bare
This operation is safe if the squashed quosure is used for
labelling or printing (see
if the squashed quosure is evaluated, all expressions of the
flattened quosures are resolved in a single environment. This is a
source of bugs so it is good practice to set
let the user know about the lossy squashing.
quo_squash(quo, warn = FALSE)
A quosure or expression.
Whether to warn if the quosure contains other quosures
(those will be collapsed). This is useful when you use
This function replaces
quo_expr() which was soft-deprecated in
quo_expr() was a misnomer because it implied that it
was a mere expression acccessor for quosures whereas it was really
a lossy operation that squashed all nested quosures.
#> <quosure> #> expr: ^wrapper(^wrappee) #> env: 0x91bdaa8# quo_squash() flattens all the quosures and returns a simple expression: quo_squash(quo)#> wrapper(wrappee)