R/walk_lang.R

Defines functions walk_lang

walk_lang <- function(x, f, ...) {

  f(x, ...)

  if (is.function(x)) {
    walk_lang(formals(x), f, ...)
    walk_lang(body(x), f, ...)

  } else if (is.call(x) || is.pairlist(x) || is.expression(x) || is.list(x)) {
    lapply(x, walk_lang, f = f, ...)
  }

  invisible()
}
MangoTheCat/functionMap documentation built on May 7, 2019, 2:10 p.m.