I'm having an issue with the typical workflow with one of my modules, but generally it seems to be working. I had been developing code in-line (eg writing and evaluating functions in the same file), but it was getting complicated, so I wrapped the functions in a module and started a new
scratch.jl file as suggested. I evaluated the entire module file, and then switched the context for
scratch.jl to the module. All of this worked as expected.
But when I went to change a function definition in the module file and re-evaluated it, the new function definition did not transfer over. If I completely re-load the module file, this works, but I get a warning:
And then I have to re-evaluate everything in
Same thing is true if I try to write a new function.
I decided to test this out in a new module - I made
function bar(a, b)
end # module Foo
Evaluated that file, switched the context of scratch.jl, and did:
Then updated the function definition to
a+3b, evaluated it, switched to
scratch,jl and got
7 as expected when running the function.
Then I tried to make a new function of the same type in my
GenbankParse module, this did not work (either with a new function definition or re-evaluating to change the function).
I reloaded Atom, and tried again. It still seems to work with module
Foo, even when switching back and forth, but it still will not work for module
GenbankParse, whether I try that first or second. I've tried evaluating the changed functions in both
scratch.jl and the terminal with the same effect (changing the function definition works in
Foo, but not in
I tried eliminating everything in
GenbankParse except for the
bar function definition, it still doesn't work. I noticed that
foo.jl was outside of the
src/ folder, while both
scratch.jl were in the
src/ folder, but moving things around (either moving
src/ or pulling
GenbankParse.jl outside of
src/) doesn't seem to affect things.
Curiouser and curiouser. I made a new file in the same place, and changed the module name to
gbkparse. In this module, everything works as expected. I changed the name in that file to
genbankparse, and this also works, as does
GbkParse. But when I changed the module name in this new file to
GenbankParse (the same as the original problem module), it stops working. Furthermore, if I go back to the original file, and change its name, it still does not work.
But if I restart Atom, the new file works with
GenbankParse as the name, but the old file with a new name still doesn't work. The last thing I can think of that's different is that the original file is tracked by git and the others aren't, but adding the others to git doesn't do anything.
So with a little more tinkering, I now have a file with the exact same content as was in the original problem file, has the same module name and is tracked by git, but it seems to work as expected. I am very confused.