Using different versions of the same module

I have a module named KIT in a single file named KIT.jl.
using KIT is all what I need for using it.

If I have different versions of the file in the same directory
(e.g. KIT_2017-09-30.jl, KIT_2017-10-15.jl)
how can I use them without first renaming to KIT.jl ?

The automatic loading in using designed/should not be used for that. Just include the file. You’ll obviously get name conflict if you’ve already imported one version and if you really want to have multiple versions loaded as the same time and confident that your own module can actually handle this you can wrap the include in another module that has a different name, i.e. module V1 include("v1.jl") end; module V2 include("v2.jl") end

1 Like

Thank you for the explanation.
So it seems I have to keep renaming backup files.

As the first line of each backup file is already module KIT,
and I prefer not touching the backup files,
this seems to be the only option now.

(Even after calling workspace() which I forgot to mention.)

Also note that using a version control system, e.g. git, is usually a much better option…

1 Like


Still many potential users work with a local workflow,
so I think the original question was relevant.

Sure, but

is irrelevant. Version control, especially distributed version control systems like git, is a local workflow.

Indeed, you can use git locally. Works really well.

I don’t know of your current workflow, but to work package development, I find Revise.jl to be really useful.