smbache/magrittr — pull request #61 by casallas (2014-12-30 06:22:32+00:00)
Title: Accept funs preceded by "::", ":::" without parens

I had reported in #12 that magrittr doesn't accept functions preceded by `::` without parentheses (e.g. `2 %>% base::sqrt`, which is a silly, but simple example), but I also realized that the infix `:::` isn't supported either.

@smbache mentioned that `::` is really just a function and he's right, but I haven't yet seen a piece of code like ```::`(base, sqrt)``, and AFAIK that can't be translated to pipe-like syntax (``base %>% `::`(sqrt)`` doesn't work since it doesn't recognize `base`). However I often find myself specifying namespaces to ensure that I'm calling the right function, e.g. `lme4::VarCorr` vs. `nlme::VarCorr`, `magrittr::extract` vs. `rstan::extract`, etc.

The solution proposed by @smbache, namely surrounding the expression with parens (e.g. `2 %>% (base::sqrt)`), works but I feel like it's unnecessarily verbose and in a way counterintuitive, i.e. if `2 %>% sqrt` works, I would expect `2 %>% base::sqrt` to work, just as I expect `sqrt(2)` and `base::sqrt(2)` to work as well.