Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use <attach> to dynamically export optional components in the search space #34

Open
bedantaguru opened this issue Apr 6, 2020 · 1 comment

Comments

@bedantaguru
Copy link
Member

Following is the prototype

nev <- new.env()

get_new_var <- function(){

  attach(nev, pos = 2L, name = "pkg:internals")
}


nev$`%+%` <- function(x, y){
  x*y
}

Note that the above needs to be tuned for the fact that it does not detach on the unload of the package.

@bedantaguru
Copy link
Member Author

bedantaguru commented Nov 6, 2020

Check this r-rudra/patch#3

Done in dynamic_attachment.R
and in zzz.R

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant