My workflow is to usually have a
init.jl file which brings some variables into scope, e.g.
saveDir = "/path". Then all my scripts start with
include("init.jl"). However, I noticed that this wasn’t always working, so I ended up doing
global saveDir = "/path" (I know this is terrible practice, but hence the question).
I just tried to prove this to myself with a small example, but wasn’t able to get it to work. I thought it may have something to do with the fact that I ran
include from a script and not the REPL, but I that wasn’t the case either. I feel like I couldn’t have imagined this behaviour - has anyone else experienced this? Or has an explanation for when and why this happens?