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

Unify interface of import function #119

Closed
klmr opened this issue Jun 29, 2017 · 2 comments
Closed

Unify interface of import function #119

klmr opened this issue Jun 29, 2017 · 2 comments

Comments

@klmr
Copy link
Owner

klmr commented Jun 29, 2017

There should only be one single import function that, depending on the format of the import path (and potentially other options) decides what to import from where.

One possible idea would look as follows:

  • Module (qualified name — unqualified names are no longer supported):

    m = mod::import(qualified/modname)
    n = mod::import(./modname)
    o = mod::import(../modname)
    …
  • Package:

    p = mod::import(pkgname)
  • Module from external source:

    m = mod::import(github:qualified/modname)

    This would require the existence of a “provider” service github that knows how to locate, load (and cache?) modules from that source. This last point might become complicated once versioning is involved.

This might also incorporate version specifiers (e.g. by adding a suffix of the form >='1.0.0', or @'rev'). See #28.


Yes, these are all unquoted. stringly typing is verboten. I’m as yet undecided whether the final version will support quoted specifications at all — probably not. Similarly, I’m not sure yet whether tidyeval support is desirable, but import_ will probably die.

@klmr
Copy link
Owner Author

klmr commented Jul 10, 2017

Also consider changing the import name. I like it, but maybe alternatives are better:

  • use
  • lib
  • load
  • require

@klmr klmr mentioned this issue Oct 3, 2017
@mschubert
Copy link
Collaborator

superseded by #129

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