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

support multiple versions #4

Open
tromey opened this issue Dec 31, 2014 · 2 comments
Open

support multiple versions #4

tromey opened this issue Dec 31, 2014 · 2 comments

Comments

@tromey
Copy link
Owner

tromey commented Dec 31, 2014

It would be nice to support the import of multiple versions of a module at a time.

The simplest way would seem to put the module version into the symbol name. Then define-module would take a version (optionally), as would import-module. Say:

(define-module testmodule :version "1.7")
(import-module something :version "1.2")

Probably needed is some way to express anti-dependencies for importing. And, it would be super to integrate nicely with what package does.

There are some additional wrinkles when a module has user-facing features:

  • We'd want to export unversioned names of at least interactive functions and defcustom variables (and perhaps just all public symbols) so that users could refer to them without difficulty. This could be done using defalias and defvaralias.
  • We should provide a new module-newest-p function so that a module can detect if it is the newest version being loaded. That would provide it the ability to install key bindings and perhaps upgrade from earlier versions. Some investigation is needed to see how this would work with byte-compilation.
@tromey
Copy link
Owner Author

tromey commented Jan 4, 2015

It may be better to do this by putting symbols into a new obarray. This would make it so things like M-x something-TAB don't show a bunch of versioned symbols. Some other thoughts:

  • There isn't a good way to actually load multiple versions, at least not without changes to package.
  • If we make the module symbol hold a weak hash table (with a strong reference to just the most recent module version), and have an import also reference the obarray, we can make it so unreferenced modules are GCd.

@tromey
Copy link
Owner Author

tromey commented Jan 10, 2015

One idea is to make explicit the notion of a "loader". Code could make a new loader and give it a load path.

This still doesn't really solve the problems related to activating the correct version of a package from the package archive. But it does make other uses possible.

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

1 participant