{"action":"created","issue":{"url":"https://api.github.com/repos/r-lib/rlang/issues/503","repository_url":"https://api.github.com/repos/r-lib/rlang","labels_url":"https://api.github.com/repos/r-lib/rlang/issues/503/labels{/name}","comments_url":"https://api.github.com/repos/r-lib/rlang/issues/503/comments","events_url":"https://api.github.com/repos/r-lib/rlang/issues/503/events","html_url":"https://github.com/r-lib/rlang/issues/503","id":320336697,"number":503,"title":"with_return() ?","user":{"login":"hadley","id":4196,"avatar_url":"https://avatars3.githubusercontent.com/u/4196?v=4","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},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-04T16:20:40Z","updated_at":"2018-05-11T11:40:43Z","closed_at":null,"author_association":"OWNER","body":"```R\r\ntry_parse_eval <- function(text, env = globalenv()) {\r\n  callCC(function(return) {\r\n    expr <- tryCatch(parse(text = text), error = function(e) return(NULL))\r\n    res <- tryCatch(eval(expr, env), error = function(e) return(NULL))\r\n    res\r\n  })\r\n}\r\n\r\n# ->\r\n\r\ntry_parse_eval <- function(text, env = globalenv()) {\r\n  with_return({\r\n    expr <- tryCatch(parse(text = text), error = function(e) return(NULL))\r\n    res <- tryCatch(eval(expr, env), error = function(e) return(NULL))\r\n  })\r\n  res\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/r-lib/rlang/issues/comments/388339897","html_url":"https://github.com/r-lib/rlang/issues/503#issuecomment-388339897","issue_url":"https://api.github.com/repos/r-lib/rlang/issues/503","id":388339897,"user":{"login":"lionel-","id":4465050,"avatar_url":"https://avatars2.githubusercontent.com/u/4465050?v=4","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},"created_at":"2018-05-11T11:40:43Z","updated_at":"2018-05-11T11:40:43Z","author_association":"OWNER","body":"In the same line of ideas: we could add a `return()` function in data masks to fix its semantics:\r\n\r\n```r\r\nwrapper <- function(df, ...) {\r\n  df %>% mutate(..., new_col = {\r\n    if (foo) {\r\n      return(tibble())\r\n    } else {\r\n      something_else\r\n  })\r\n}\r\n```"}}
{"actor":{"display_login":"lionel-"}}