The use of : as part of the module path in use, as described in the documentation to control which part of the module spec becomes the module name, is extremely useful, since one cannot always control the name of the modules. For example, if I want to use both elvish-completions/git and elvish-libs/git, this makes it possible:
use github.com/zzamboni/elvish-completions:git
use github.com/muesli/elvish-libs/git
Without the : syntax, the later module overrides the earlier, making it impossible to access.
@xiaq: you mentioned somewhere (but can't find it at the moment) that this syntax might be removed eventually. I would like to formally request that you keep this very useful syntax.
What about extending the syntax to allow the use of a module under a different name instead?
use github.com/muesli/elvish-libs/git as mgit
then access the module as mgit:.
This seems more general, as you might wish to import several identically named modules. Or maybe you just don't like to use a module's original name.
@hanche that would work as well for me :) I proposed this since the current functionality is already there and epm packages are identified by their "full path" anyway, so it's easy to make them unique.
The plan to support importing the module under a custom name, using the syntax use some/mod &as=any-name.
Most helpful comment
What about extending the syntax to allow the use of a module under a different name instead?
then access the module as
mgit:.This seems more general, as you might wish to import several identically named modules. Or maybe you just don't like to use a module's original name.