This question already has an answer here:
- Testing a package in Mathematica 9 3 answers
I'm using IntelliJ Idea with a Mathematica plugin to develop Mathematica application. I keep IntelliJ and Mathematica opened at the same time. I would like to change something in the IDE, evaluate notebook in the Mathematica and see updated result, but Mathematica fails to see changes in my code.
My application consists of several subpackages, and
Kernel/init.m looks like
Get["MyPackage`A`"] Get["MyPackage`B`"] ...
Notebook is something like
Quit Get["MyPackage`"] SomeFunctionFromMyPackage
And I've also tried
Needs["Utilities`CleanSlate`"] (* inside initialization cell *) CleanSlate Get["MyPackage`"] SomeFunctionFromMyPackage
Let's say I changed
.m file` hit "Evaluate notebook" and hoping to see result changing, but this doesn't happen. Result is not getting updated. I've tried to introduce syntax error in function, Mathematica doesn't react at all.
The only way to force Mathematica to actually reload my package is to restart it.
It's driving me crazy, what am I doing wrong?
Such strange problems were caused by the fact that subpackages inside application depend on each other with
Needs instead of
Get. When I changed it to
Get the problems went away.