This is normal/expected behavior. Check out the manual chapter on the scope of variables: http://docs.julialang.org/en/latest/manual/variables-and-scoping/.
In particular, there are certain "blocks" of code that introduce a scope and once that scope is done, all variables that were introduced within that scope go away. -Jacob On Mon, Oct 20, 2014 at 8:20 AM, Felipe Jiménez <[email protected]> wrote: > This is my first question here. I'm starting with Julia, so sorry if this > is too simple. > > I am used to programming mostly in Matlab, so the following behavior has > surprised me. > > I use the variable jjmin inside a for loop (not a function). After the > loop finishes, its value is "forgotten"! Is this normal? > > Please find the file attached (you can run it or see its output commented > at the end). > > Thank you in advance! > > F > >
