Description Usage Arguments Value Examples
compose visitor functions
1 | lhs %then% rhs
|
lhs |
visitor object |
rhs |
visitor object |
composed visitor object
1 2 3 4 5 6 7 8 9 10 | add1 <- make_visitor(
leaf = function(x) if(is.numeric(x)) x + 1 else x
)
mul2 <- make_visitor(
leaf = function(x) if(is.numeric(x)) x * 2 else x
)
walk_ast(quote(1 + 2 * 3), add1)
walk_ast(quote(1 + 2 * 3), mul2)
walk_ast(quote(1 + 2 * 3), add1 %then% mul2)
walk_ast(quote(1 + 2 * 3), mul2 %then% add1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.