I think you're hitting this issue: https://github.com/JuliaLang/julia/issues/265
-- John On Jul 10, 2014, at 1:31 AM, Johannes Degn <[email protected]> wrote: > > > Im not sure if this is a bug or if I am a bug. Maybe someone can explain this > to me: > > I am running julia Version 0.3.0-prerelease+3649 on linux. > > I was working on some code and testing it while running a repl. Simplified I > did something like the following: > > function a() > b() > end > function b() > 3 > end > > So obviously a() looks in the global score for the function b and returns 3. > If I then run > function b() > 4 > end > > in the same repl I still get 3 if I run a(). Somehow running a() seems to not > look up the symbol b again. Ok so far so good. So now I am writing this up > and to confirm that I did not make stupid mistake I try to replicate this > again but for no specific reason I change the order somewhat: > > function a() > b() > end > > julia> a() > ERROR: b not defined > in a at none:2 > > function b() > 3 > end > > julia> a() > 3 > > function b() > 4 > end > > julia> a() > 4 > > So now I am really confused. Calling a() before b is defined makes a lookup b > when a is run again?
