Description Usage Arguments Examples
replace call object Replacement
1 2 3 |
before |
a language object or literal |
after |
a language object or literal |
expr |
a language object |
target |
a langage object that you want to replace |
count |
count of iteration |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | walk_ast(quote(x + y + z), replace(quote(y), quote(www)))
walk_ast(quote(x + x + x), replace(quote(x + x), quote(x)))
# because `y + x + x` is parsed as `((y + x) + x)`,
# the next code manipulates nothing
walk_ast(quote(y + x + x), replace(quote(x + x), quote(x)))
walk_ast(quote(1 + 2 + x ^ 3), replace(quote(x), quote(y)))
walk_ast(quote(1 + 2 + x ^ 3), replace(quote(x^3), quote(y)))
walk_ast(quote(1 + 2 + x ^ 3), replace(quote(2), quote(99)))
walk_ast(quote(1 + 2 + x ^ 3), replace(quote(1+2), quote(99)))
walk_ast(quote(1 + 2 + x ^ 3), replace(quote(`+`), quote(`-`)))
nest_expr(quote((1 + x)^2), quote(x), 3)
nest_expr(quote((1 + x)^2), quote(1 + x), 3)
eval(nest_expr(quote(1 + 1 / x), quote(x), 40), list(x = 1)) == (1 + sqrt(5)) / 2
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.