In general, local scopes are not first-class in Julia. When you call eval, the code is executed in the current module's global scope and similarly, isdefined tells you whether a variable is defined in the current module's global scope.
On Sun, Feb 9, 2014 at 5:34 PM, Bill Janssen <bill.jans...@gmail.com> wrote: > I'm still struggling with understanding Julia's scopes. Are they > consistent? Why does the following happen? I'd expect "y" to be lexically > bound by the let. This is version 0.2. > > julia> let y = 4; eval(symbol("y")); end > ERROR: y not defined > > In addition, one can refer to certain scopes (modules, types) with > functions such as isdefined(), but not to others (let scopes, for > instance). Why is that? > >