Imagine that you have many plotting calls that you’re using to debug the code that you are developing. At some point you want to be able to erase the plotting code quickly, commit the changes on git and reinsert the plotting code before development can continue.
I tried to solve this problem with a simple
include as follows:
function foo() # do something fancy fancyobj = ... include("plotting.jl") # more fancy operations fancyobj = ... return fancyobj
using PyPlot # plotting code using variables defined in foo plot(fancyobj) xlabel(); ylabel()... title(...)...
So whenever I need to commit my changes, I erase a single line
include("plotting.jl"), commit and insert it back. The problem is that I am getting this
fancyobj. I assumed that
include is equivalent to just pasting the code in place, is that incorrect? If this is the expected behavior, what is a better solution to the problem?