{"action":"created","comment":{"url":"https://api.github.com/repos/hadley/rlang/pulls/comments/87196554","pull_request_review_id":7817158,"id":87196554,"diff_hunk":"@@ -64,13 +235,43 @@ call_modify <- function(call, new_args, env = parent.frame()) {\n   call\n }\n \n-#' @rdname call_modify\n+get_call <- function(call) {\n+  if (is_frame(call)) {\n+    call$expr\n+  } else if (is_formula(call)) {\n+    f_rhs(call)\n+  } else {\n+    call\n+  }\n+}\n+\n+#' Function name of a call\n+#'\n+#' @inheritParams call_standardise\n+#' @return A string with the function name.\n #' @export\n-call_standardise <- function(call, env = parent.frame()) {\n-  stopifnot(is_call(call))\n+#' @examples\n+#' # Extract the function name from quoted calls:\n+#' call_fn_name(~foo(bar))\n+#' call_fn_name(quote(foo(bar)))\n+#'\n+#' # The calling expression is used as default:\n+#' foo <- function(bar) call_fn_name()\n+#' foo(bar)\n+#'\n+#' # Namespaced calls are correctly handled:\n+#' call_fn_name(~base::matrix(baz))\n+#' call_fn_name(~foo$bar(baz))\n+call_fn_name <- function(call = NULL) {\n+  call <- call %||% call_frame(2)\n+  call <- get_call(call)\n+  stopifnot(is.call(call))\n+  fn <- call[[1]]\n \n-  f <- eval(call[[1]], env)\n-  if (is.primitive(f)) return(call)\n+  # Handle namespaced calls: foo::bar(), foo@bar(), foo$bar()","path":"R/call.R","position":241,"original_position":241,"commit_id":"5fe6ebb42cb5627eb3531d748a5fc81c3afdbc9f","original_commit_id":"5fe6ebb42cb5627eb3531d748a5fc81c3afdbc9f","user":{"login":"lionel-","id":4465050,"avatar_url":"https://avatars.githubusercontent.com/u/4465050?v=3","gravatar_id":"","url":"https://api.github.com/users/lionel-","html_url":"https://github.com/lionel-","followers_url":"https://api.github.com/users/lionel-/followers","following_url":"https://api.github.com/users/lionel-/following{/other_user}","gists_url":"https://api.github.com/users/lionel-/gists{/gist_id}","starred_url":"https://api.github.com/users/lionel-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lionel-/subscriptions","organizations_url":"https://api.github.com/users/lionel-/orgs","repos_url":"https://api.github.com/users/lionel-/repos","events_url":"https://api.github.com/users/lionel-/events{/privacy}","received_events_url":"https://api.github.com/users/lionel-/received_events","type":"User","site_admin":false},"body":"yup this returns `NULL` as well.","created_at":"2016-11-09T14:00:04Z","updated_at":"2016-11-09T14:00:04Z","html_url":"https://github.com/hadley/rlang/pull/1#discussion_r87196554","pull_request_url":"https://api.github.com/repos/hadley/rlang/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/hadley/rlang/pulls/comments/87196554"},"html":{"href":"https://github.com/hadley/rlang/pull/1#discussion_r87196554"},"pull_request":{"href":"https://api.github.com/repos/hadley/rlang/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/hadley/rlang/pulls/1","id":92855809,"html_url":"https://github.com/hadley/rlang/pull/1","diff_url":"https://github.com/hadley/rlang/pull/1.diff","patch_url":"https://github.com/hadley/rlang/pull/1.patch","issue_url":"https://api.github.com/repos/hadley/rlang/issues/1","number":1,"state":"open","locked":false,"title":"Rewrite call_standardise()","user":{"login":"lionel-","id":4465050,"avatar_url":"https://avatars.githubusercontent.com/u/4465050?v=3","gravatar_id":"","url":"https://api.github.com/users/lionel-","html_url":"https://github.com/lionel-","followers_url":"https://api.github.com/users/lionel-/followers","following_url":"https://api.github.com/users/lionel-/following{/other_user}","gists_url":"https://api.github.com/users/lionel-/gists{/gist_id}","starred_url":"https://api.github.com/users/lionel-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lionel-/subscriptions","organizations_url":"https://api.github.com/users/lionel-/orgs","repos_url":"https://api.github.com/users/lionel-/repos","events_url":"https://api.github.com/users/lionel-/events{/privacy}","received_events_url":"https://api.github.com/users/lionel-/received_events","type":"User","site_admin":false},"body":"and add some tools for pairlists.","created_at":"2016-11-08T20:47:26Z","updated_at":"2016-11-09T14:00:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"93196a02c048e37e381b4601b5855ee18c95d56e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hadley/rlang/pulls/1/commits","review_comments_url":"https://api.github.com/repos/hadley/rlang/pulls/1/comments","review_comment_url":"https://api.github.com/repos/hadley/rlang/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hadley/rlang/issues/1/comments","statuses_url":"https://api.github.com/repos/hadley/rlang/statuses/5fe6ebb42cb5627eb3531d748a5fc81c3afdbc9f","head":{"label":"lionel-:feature-call-standardise","ref":"feature-call-standardise","sha":"5fe6ebb42cb5627eb3531d748a5fc81c3afdbc9f","user":{"login":"lionel-","id":4465050,"avatar_url":"https://avatars.githubusercontent.com/u/4465050?v=3","gravatar_id":"","url":"https://api.github.com/users/lionel-","html_url":"https://github.com/lionel-","followers_url":"https://api.github.com/users/lionel-/followers","following_url":"https://api.github.com/users/lionel-/following{/other_user}","gists_url":"https://api.github.com/users/lionel-/gists{/gist_id}","starred_url":"https://api.github.com/users/lionel-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lionel-/subscriptions","organizations_url":"https://api.github.com/users/lionel-/orgs","repos_url":"https://api.github.com/users/lionel-/repos","events_url":"https://api.github.com/users/lionel-/events{/privacy}","received_events_url":"https://api.github.com/users/lionel-/received_events","type":"User","site_admin":false},"repo":{"id":73101742,"name":"rlang","full_name":"lionel-/rlang","owner":{"login":"lionel-","id":4465050,"avatar_url":"https://avatars.githubusercontent.com/u/4465050?v=3","gravatar_id":"","url":"https://api.github.com/users/lionel-","html_url":"https://github.com/lionel-","followers_url":"https://api.github.com/users/lionel-/followers","following_url":"https://api.github.com/users/lionel-/following{/other_user}","gists_url":"https://api.github.com/users/lionel-/gists{/gist_id}","starred_url":"https://api.github.com/users/lionel-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lionel-/subscriptions","organizations_url":"https://api.github.com/users/lionel-/orgs","repos_url":"https://api.github.com/users/lionel-/repos","events_url":"https://api.github.com/users/lionel-/events{/privacy}","received_events_url":"https://api.github.com/users/lionel-/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lionel-/rlang","description":null,"fork":true,"url":"https://api.github.com/repos/lionel-/rlang","forks_url":"https://api.github.com/repos/lionel-/rlang/forks","keys_url":"https://api.github.com/repos/lionel-/rlang/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lionel-/rlang/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lionel-/rlang/teams","hooks_url":"https://api.github.com/repos/lionel-/rlang/hooks","issue_events_url":"https://api.github.com/repos/lionel-/rlang/issues/events{/number}","events_url":"https://api.github.com/repos/lionel-/rlang/events","assignees_url":"https://api.github.com/repos/lionel-/rlang/assignees{/user}","branches_url":"https://api.github.com/repos/lionel-/rlang/branches{/branch}","tags_url":"https://api.github.com/repos/lionel-/rlang/tags","blobs_url":"https://api.github.com/repos/lionel-/rlang/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lionel-/rlang/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lionel-/rlang/git/refs{/sha}","trees_url":"https://api.github.com/repos/lionel-/rlang/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lionel-/rlang/statuses/{sha}","languages_url":"https://api.github.com/repos/lionel-/rlang/languages","stargazers_url":"https://api.github.com/repos/lionel-/rlang/stargazers","contributors_url":"https://api.github.com/repos/lionel-/rlang/contributors","subscribers_url":"https://api.github.com/repos/lionel-/rlang/subscribers","subscription_url":"https://api.github.com/repos/lionel-/rlang/subscription","commits_url":"https://api.github.com/repos/lionel-/rlang/commits{/sha}","git_commits_url":"https://api.github.com/repos/lionel-/rlang/git/commits{/sha}","comments_url":"https://api.github.com/repos/lionel-/rlang/comments{/number}","issue_comment_url":"https://api.github.com/repos/lionel-/rlang/issues/comments{/number}","contents_url":"https://api.github.com/repos/lionel-/rlang/contents/{+path}","compare_url":"https://api.github.com/repos/lionel-/rlang/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lionel-/rlang/merges","archive_url":"https://api.github.com/repos/lionel-/rlang/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lionel-/rlang/downloads","issues_url":"https://api.github.com/repos/lionel-/rlang/issues{/number}","pulls_url":"https://api.github.com/repos/lionel-/rlang/pulls{/number}","milestones_url":"https://api.github.com/repos/lionel-/rlang/milestones{/number}","notifications_url":"https://api.github.com/repos/lionel-/rlang/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lionel-/rlang/labels{/name}","releases_url":"https://api.github.com/repos/lionel-/rlang/releases{/id}","deployments_url":"https://api.github.com/repos/lionel-/rlang/deployments","created_at":"2016-11-07T17:05:53Z","updated_at":"2016-11-07T17:05:54Z","pushed_at":"2016-11-08T21:56:43Z","git_url":"git://github.com/lionel-/rlang.git","ssh_url":"git@github.com:lionel-/rlang.git","clone_url":"https://github.com/lionel-/rlang.git","svn_url":"https://github.com/lionel-/rlang","homepage":null,"size":306,"stargazers_count":0,"watchers_count":0,"language":"R","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hadley:master","ref":"master","sha":"4d77069b46c2b22034dc0277ea6e4fdbb8a137c7","user":{"login":"hadley","id":4196,"avatar_url":"https://avatars.githubusercontent.com/u/4196?v=3","gravatar_id":"","url":"https://api.github.com/users/hadley","html_url":"https://github.com/hadley","followers_url":"https://api.github.com/users/hadley/followers","following_url":"https://api.github.com/users/hadley/following{/other_user}","gists_url":"https://api.github.com/users/hadley/gists{/gist_id}","starred_url":"https://api.github.com/users/hadley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hadley/subscriptions","organizations_url":"https://api.github.com/users/hadley/orgs","repos_url":"https://api.github.com/users/hadley/repos","events_url":"https://api.github.com/users/hadley/events{/privacy}","received_events_url":"https://api.github.com/users/hadley/received_events","type":"User","site_admin":false},"repo":{"id":73098312,"name":"rlang","full_name":"hadley/rlang","owner":{"login":"hadley","id":4196,"avatar_url":"https://avatars.githubusercontent.com/u/4196?v=3","gravatar_id":"","url":"https://api.github.com/users/hadley","html_url":"https://github.com/hadley","followers_url":"https://api.github.com/users/hadley/followers","following_url":"https://api.github.com/users/hadley/following{/other_user}","gists_url":"https://api.github.com/users/hadley/gists{/gist_id}","starred_url":"https://api.github.com/users/hadley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hadley/subscriptions","organizations_url":"https://api.github.com/users/hadley/orgs","repos_url":"https://api.github.com/users/hadley/repos","events_url":"https://api.github.com/users/hadley/events{/privacy}","received_events_url":"https://api.github.com/users/hadley/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hadley/rlang","description":null,"fork":false,"url":"https://api.github.com/repos/hadley/rlang","forks_url":"https://api.github.com/repos/hadley/rlang/forks","keys_url":"https://api.github.com/repos/hadley/rlang/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hadley/rlang/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hadley/rlang/teams","hooks_url":"https://api.github.com/repos/hadley/rlang/hooks","issue_events_url":"https://api.github.com/repos/hadley/rlang/issues/events{/number}","events_url":"https://api.github.com/repos/hadley/rlang/events","assignees_url":"https://api.github.com/repos/hadley/rlang/assignees{/user}","branches_url":"https://api.github.com/repos/hadley/rlang/branches{/branch}","tags_url":"https://api.github.com/repos/hadley/rlang/tags","blobs_url":"https://api.github.com/repos/hadley/rlang/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hadley/rlang/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hadley/rlang/git/refs{/sha}","trees_url":"https://api.github.com/repos/hadley/rlang/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hadley/rlang/statuses/{sha}","languages_url":"https://api.github.com/repos/hadley/rlang/languages","stargazers_url":"https://api.github.com/repos/hadley/rlang/stargazers","contributors_url":"https://api.github.com/repos/hadley/rlang/contributors","subscribers_url":"https://api.github.com/repos/hadley/rlang/subscribers","subscription_url":"https://api.github.com/repos/hadley/rlang/subscription","commits_url":"https://api.github.com/repos/hadley/rlang/commits{/sha}","git_commits_url":"https://api.github.com/repos/hadley/rlang/git/commits{/sha}","comments_url":"https://api.github.com/repos/hadley/rlang/comments{/number}","issue_comment_url":"https://api.github.com/repos/hadley/rlang/issues/comments{/number}","contents_url":"https://api.github.com/repos/hadley/rlang/contents/{+path}","compare_url":"https://api.github.com/repos/hadley/rlang/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hadley/rlang/merges","archive_url":"https://api.github.com/repos/hadley/rlang/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hadley/rlang/downloads","issues_url":"https://api.github.com/repos/hadley/rlang/issues{/number}","pulls_url":"https://api.github.com/repos/hadley/rlang/pulls{/number}","milestones_url":"https://api.github.com/repos/hadley/rlang/milestones{/number}","notifications_url":"https://api.github.com/repos/hadley/rlang/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hadley/rlang/labels{/name}","releases_url":"https://api.github.com/repos/hadley/rlang/releases{/id}","deployments_url":"https://api.github.com/repos/hadley/rlang/deployments","created_at":"2016-11-07T16:28:57Z","updated_at":"2016-11-09T02:25:30Z","pushed_at":"2016-11-08T21:58:22Z","git_url":"git://github.com/hadley/rlang.git","ssh_url":"git@github.com:hadley/rlang.git","clone_url":"https://github.com/hadley/rlang.git","svn_url":"https://github.com/hadley/rlang","homepage":null,"size":271,"stargazers_count":4,"watchers_count":4,"language":"R","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hadley/rlang/pulls/1"},"html":{"href":"https://github.com/hadley/rlang/pull/1"},"issue":{"href":"https://api.github.com/repos/hadley/rlang/issues/1"},"comments":{"href":"https://api.github.com/repos/hadley/rlang/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/hadley/rlang/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/hadley/rlang/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hadley/rlang/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/hadley/rlang/statuses/5fe6ebb42cb5627eb3531d748a5fc81c3afdbc9f"}}}}
{"actor":{"display_login":"lionel-"}}