fn_body()
is a simple wrapper around base::body()
. It always
returns a {
expression and throws an error when the input is a
primitive function (whereas body()
returns NULL
). The setter
version preserves attributes, unlike body<-
.
fn_body(fn = caller_fn()) fn_body(fn) <- value
fn | A function. It is lookep up in the calling frame if not supplied. |
---|---|
value | New formals or formals names for |
#> do()fn_body(fn)#> { #> do() #> }