Skip to content

Commit

Permalink
Accept functions preceded by "::" without parens
Browse files Browse the repository at this point in the history
  • Loading branch information
casallas committed May 29, 2014
1 parent 810f47f commit 56a7540
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/magrittr.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ pipe <- function(tee = FALSE)
# Case of a function: rare but possible
res <- withVisible(rhs(env[[nm]]))

} else if (is.call(rhs) && deparse(rhs[[1]]) == "function") {
} else if (is.call(rhs) && deparse(rhs[[1]]) %in% c("function", "::")) {

# Anonymous function:
# Anonymous function, or function name without parens preceded by "::"
res <- withVisible(eval(rhs, parent.frame(), parent.frame())(
eval(lhs, parent.frame(), parent.frame())))

Expand Down

0 comments on commit 56a7540

Please sign in to comment.