You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/17 09:03:17 UTC

[GitHub] [arrow] dragosmg commented on pull request #13160: ARROW-14575: [R] Allow functions with `pkg::` prefixes

dragosmg commented on PR #13160:
URL: https://github.com/apache/arrow/pull/13160#issuecomment-1128610905

   It sounds like having a defused version of the `::` operator is the way to go (instead of syntax translation). I have a proposal for a `::` binding.
   Another design choice would be the location for the bindings. Do we want?
   * a single bucket (i.e. `nse_funcs`) to hold all of them?
   * individual bucket per namespace: `use_funcs[[package]]`
   * a mixed approach:
       * a general bucket: `use_funcs[[all_function]]` where all bindings live (in their namespace-unqualified form - i.e. `as_datetime()`
       * package specific buckets: `use_funcs[[package]]`
   
   I am in favour of the _mixed_ approach, which would make the `::` binding something like.
   ```r
   arrow:::register_binding("::", function(lhs, rhs) {
     lhs_name <- as.character(substitute(lhs))
     rhs_name <- as.character(substitute(rhs))
     arrow:::nse_funcs[[lhs_name]][[rhs_name]]
   })
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org