# NOT RUN {
# Extract the function name from quoted calls:
call_name(quote(foo(bar)))
call_name(quo(foo(bar)))
# Or from a frame:
foo <- function(bar) call_name(call_frame())
foo(bar)
# Namespaced calls are correctly handled:
call_name(~base::matrix(baz))
# Anonymous and subsetted functions return NULL:
call_name(quote(foo$bar()))
call_name(quote(foo[[bar]]()))
call_name(quote(foo()()))
# }
Run the code above in your browser using DataLab