There is a new random.nim module in /lib/pure in the devel branch which gets imported rather than the random.nim from the nimble installed nim-random by blaxpirit. Other than putting the absolute path to the nimble pkgs is there any way to tell import which random.nim I want? Putting absolute paths in a library is not a good idea so I want to avoid it.
# imports the module from /lib/pure
import random
# imports the module I want due to more functionality
import "/some/path/.nimble/pkgs/random-0.5.2/random"
import "$lib/pure/random"
vs
import "random-0.5.2/random"
(I hope this works, if not, we have to make it work.)
import "random-0.5.2/random"
works but still not perfect , because if there is a random-0.5.3 version it would break again rather than automatically use the latest.
maybe we can have something like:
#pseudocode for importing modules installed via nimble
importnimble random
which would take care of that situation and also makes it clear which module is in use. As with increasing proliferation of modules, name clashes maybe unavoidable .
@qqtop: I find importnimble quite unclean personally. This exact reason is why I suggested that packages could be vendor prefixed in Nimble, much like they are in Composer for PHP: http://forum.nim-lang.org/t/2209
That way it'd be something like the following:
import 'BlaXpirit/random'
Core modules would still be imported as usual. Using the vendor prefix could be opt in too, I'm just not sure how much work that would add.
Vendor prefix is perfectly fine with me or whatever solves the issue at hand.
Only to consider github may be limiting in the long run as we see in
strfmt module which is hosted on bitbucket.
Maybe some sort of unique nimble id is the way to go ?