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