# NOT RUN {
# Symbolic objects and functions are callable:
is_callable(quote(foo))
is_callable(base::identity)
# mut_node_car() lets you modify calls without any checking:
lang <- quote(foo(10))
mut_node_car(lang, get_env())
# Use is_callable() to check an input object is safe to put as CAR:
obj <- base::identity
if (is_callable(obj)) {
lang <- mut_node_car(lang, obj)
} else {
abort("`obj` must be callable")
}
eval_bare(lang)
# }
Run the code above in your browser using DataLab