This issue has bothered me for a long time. Previously I thought it was related to my program, but the following example shows it should not.
As could be seen in the snapshot
- The REPL does have access to variable
xin the first loop.
- Then suddenly the access is lost when I want to
x += 1in the second loop.
I mainly use Julia for scientific computation and maybe there is something syntactic I am not aware of. But here I believe
x is a global variable and it could be accessed when session is open.
Could someone help me, thank you in advance.