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

Make packages loadable via import #45

Closed
klmr opened this issue Jan 17, 2015 · 3 comments
Closed

Make packages loadable via import #45

klmr opened this issue Jan 17, 2015 · 3 comments

Comments

@klmr
Copy link
Owner

klmr commented Jan 17, 2015

Add a mechanism to make installed packages available via import.

This would have the following advantages over library:

  • Uniform API for accessing library code

  • Doesn’t clutter the search path by default – encourages better style

  • Allows adapting the name for accessing packages (instead of having hard-coded pkg_name::)

  • Supports loading and using packages locally only; consider:

    frob = function (args) {
        import(package = 'pkg', attach = TRUE)
        …
    }

    Now pkg is attached, but only inside frob – just like normal modules, but unlike loading a package via library.

@klmr
Copy link
Owner Author

klmr commented Feb 4, 2015

Hmm.

  • import(package = '…'), or
  • import_package('…')

… or something else entirely?

@gaborcsardi
Copy link

import_package is easier to search for, on Github and elsewhere, so I like that better.

@klmr
Copy link
Owner Author

klmr commented Jun 26, 2015

Loading and dispatching the documentation attached to the package is tricky. I’ll omit this for now and I’ve opened an own issue for that (#54).

The prototype I’m currently working on probably has additional problems concerning the dispatch of S4 methods and operators. However, this seems to work in my ad-hoc tests. I’ll therefore release the preliminary prototype now in order to get feedback from real-life testing.

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

No branches or pull requests

2 participants